 




<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Answers &#187; Arrays (programming)</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/tag/arrays-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 09:10:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Array manipulation</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/array-manipulation/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/array-manipulation/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 06:52:27 +0000</pubDate>
		<dc:creator>Yashpal</dc:creator>
				<category><![CDATA[Array]]></category>
		<category><![CDATA[Array processing]]></category>
		<category><![CDATA[Arrays]]></category>
		<category><![CDATA[Arrays (programming)]]></category>
		<category><![CDATA[Diagonal matrix]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Java Array]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[i want to create a 10&#215;10 matrix(with user input) for e.g., i have given a small sample of 2&#215;2 matrix and below is the description regarding what manipulation i want to do. say for e.g my matrix is 0.76   1 0      0.3 now what i want to do is that, whenever the value in the [...]]]></description>
				<content:encoded><![CDATA[<p>i want to create a 10&#215;10 matrix(with user input)</p>
<p>for e.g., i have given a small sample of 2&#215;2 matrix and below is the description regarding what manipulation i want to do.</p>
<p>say for e.g my matrix is<br />
0.76   1<br />
0      0.3</p>
<p>now what i want to do is that, whenever the value in the matrix is greater than 0.25, i want to print 1 and if it is less than 0.25 than i want to print 0 and if it is 0 or 1 then let it be as it is&#8230;.<br />
so the answer for my above matrix should be</p>
<p>1    1<br />
0    0</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/array-manipulation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fill Char-elements w For Loop in Array</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/fill-char-elements-w-for-loop-in-array/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/fill-char-elements-w-for-loop-in-array/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 18:11:16 +0000</pubDate>
		<dc:creator>Kogia</dc:creator>
				<category><![CDATA[Arrays (programming)]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[New Answer by Chris Leonard]]></description>
				<content:encoded><![CDATA[New Answer by Chris Leonard]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/fill-char-elements-w-for-loop-in-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Variable Number of Elements in Array Data Structures</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/array-data-structures/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/array-data-structures/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 14:04:43 +0000</pubDate>
		<dc:creator>Ron2</dc:creator>
				<category><![CDATA[Arrays]]></category>
		<category><![CDATA[Arrays (programming)]]></category>
		<category><![CDATA[Data structures]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Is there a way to create a variable number of elements in an array data structure or multi occurrence data structure? I have an application where I need to be able to expand the elements or occurrences on the fly Thanks Ron Newman]]></description>
				<content:encoded><![CDATA[<p>Is there a way to create a variable number of elements in an array data structure or multi occurrence data structure?  I have an application where I need to be able to expand the elements or occurrences on the fly<br />
Thanks<br />
Ron Newman</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/array-data-structures/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Is it possible to assign more than one form element to one php variable?</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/parse-error-parse-error-expecting-t_string-or-t_variable-or-t_num_string/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/parse-error-parse-error-expecting-t_string-or-t_variable-or-t_num_string/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 19:46:12 +0000</pubDate>
		<dc:creator>PatOswalt</dc:creator>
				<category><![CDATA[Array]]></category>
		<category><![CDATA[Arrays (programming)]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[Parse error]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP scripts]]></category>
		<category><![CDATA[`T_NUM_STRING']]></category>
		<category><![CDATA[`T_STRING']]></category>
		<category><![CDATA[`T_VARIABLE']]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I have an HTML form file and a PHP file that are supposed to interact with eachother to save information from the form to a contactlist text file.  I had it working fine and it has been turned it, but started playing with it and now have a question. Is it possible to assign more [...]]]></description>
				<content:encoded><![CDATA[<p>I have an HTML form file and a PHP file that are supposed to interact with eachother to save information from the form to a contactlist text file.  I had it working fine and it has been turned it, but started playing with it and now have a question.</p>
<p>Is it possible to assign more than one form element to one php variable?  I want my form to have a specific text field for the area code, the prefix and the line number and then want to combine those three field into one variable.  This is not a requirement for my class, I&#8217;m just wanting to see how much I can do with this.  Here is my html code below:</p>
<pre>
&lt;html&gt;
    &lt;!--Patricia Oswalt - IT250 Unit 4 Assignment--&gt;
    
    &lt;head&gt;
        &lt;title&gt;Telephone Directory Input&lt;/title&gt;
    &lt;/head&gt;
     
    &lt;body&gt;
        &lt;h1&gt;New Directory Listing&lt;/h1&gt;
        &lt;form action="SaveDirectory.php" method="post" enctype="application/x-www-form-urlencoded"&gt;
            &lt;p&gt;Last Name &lt;input type="text" name="LastName" size="30" tabindex="1" /&gt;
            First Name &lt;input type="text" name="FirstName" size="20" tabindex="2" /&gt;&lt;/p&gt;
            &lt;p&gt;Street Address &lt;input type="text" name="StreetAdd" size="50" tabindex="3" /&gt;&lt;/p&gt;
            &lt;p&gt;City &lt;input type="text" name="City" size="30" tabindex="4" /&gt;
            State (Abbr) &lt;input type="text" name="State" size="2" tabindex="5" /&gt;
            Zip Code&lt;input type="text" name="ZipCode" size="5" tabindex="6" /&gt;&lt;/p&gt;
            &lt;p&gt;Area Code (&lt;input type="text" name="AreaCode" size="3" tabindex="7"/&gt;)
            Phone Number &lt;input type="text" name="Prefix" size="3" tabindex="8" /&gt;-&lt;input type="text" name="LineNumber" size="4" tabindex="9" /&gt;&lt;/p&gt;
            &lt;p&gt;&lt;input type="submit" value="Save" tabindex="9" /&gt;&lt;input type="reset" tabindex="10" /&gt;&lt;/p&gt;
        &lt;/form&gt;
        &lt;p&gt;&lt;a href="InputTelephone.html"&gt;Add New Listing&lt;/a&gt;&lt;/p&gt;
        &lt;p&gt;&lt;a href="contactlist.txt"&gt;Retrieve Contact List&lt;/a&gt;&lt;/p&gt;
    &lt;/body&gt;

&lt;/html&gt;
</pre>
<p>Here is my PHP code:</p>
<pre>
&lt;html&gt;
    &lt;!--Patricia Oswalt - IT250 Unit 4 Assignment--&gt;
    
    &lt;head&gt;
        &lt;title&gt;Save Directory&lt;/title&gt;
    &lt;/head&gt;
     
    &lt;body&gt;

        &lt;?php
        
        //initializing the variables
        $LastName = ($_POST['LastName']);
        $FirstName = ($_POST['FirstName']);
        $StreetAdd = ($_POST['StreetAdd']);
        $City = ($_POST['City']);
        $State = ($_POST['State']);
        $ZipCode = ($_POST['ZipCode']);
        $AreaCode = ($_POST['AreaCode']);
        $PhoneNum = ($_POST['Prefix']['LineNumb']);
            
        //confirming that all variables will contain values
        if (empty($LastName) ||
            empty($FirstName) ||
            empty($StreetAdd) ||
            empty($City) ||
            empty($State) ||
            empty($ZipCode) ||
            empty($AreaCode) ||
            empty($PhoneNum))
            echo "&lt;p&gt;You must completely fill out the form.  Please use your browser's Back button to return to the form.&lt;/p&gt;";

        else 
        //creating, writing and saving to the text file.
        $NewContact = 'contactlist.txt';
        $Contact = fopen($NewContact, 'a+');
        $output ="n $LastName n";
        $output .="n $FirstName n";
        $output .="n $StreetAdd n";
        $output .="n $City n";
        $output .="n $State n";
        $output .="n $ZipCode n";
        $output .="n $AreaCode n";
        $output .="n $PhoneNum['Prefix']['LineNumb'] n";//this is where the error in pointing to.
        echo "New Contact Saved Successfully!";
        fwrite($Contact, $output);
        fclose($Contact);

    // Split a string into an index array
        $Contacts = "$LastName;$FirstName;$StreetAdd;$City;$State;$ZipCode;$AreaCode;$PhoneNum";
        $ContactsArray = explode(";", $Contacts);
        echo "&lt;br&gt;&lt;strong&gt;Contact List&lt;/strong&gt;&lt;br&gt;&lt;br&gt;";
        for($i=0; $i&lt;count($ContactsArray); $i++) {
             echo "$ContactsArray[$I]&lt;br&gt;";
         }
    // Sort an index array
        sort($ContactsArray);
        echo "&lt;br&gt;&lt;strong&gt;Sorted Contact List&lt;/strong&gt;&lt;br&gt;&lt;br&gt;";
        foreach($ContactsArray as $Contacts) {
           echo "$Contacts&lt;br&gt;";
         }
    
        ?&gt;

    &lt;/body&gt;

&lt;/html&gt;</pre>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/parse-error-parse-error-expecting-t_string-or-t_variable-or-t_num_string/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Parsing error in a class project.  Can&#8217;t figure it out</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/parsing-error-in-a-class-project-cant-figure-it-out/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/parsing-error-in-a-class-project-cant-figure-it-out/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 18:21:30 +0000</pubDate>
		<dc:creator>PatOswalt</dc:creator>
				<category><![CDATA[Arrays (programming)]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[index arrays]]></category>
		<category><![CDATA[PHP Coding]]></category>
		<category><![CDATA[sorting arrays]]></category>
		<category><![CDATA[split strings]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This is a project for a class.  I&#8217;m unable to figure it out and I&#8217;m at my wits end.  I&#8217;m not asking for someone to do the project to me, just tell me where my coding is wrong.  My html form is correct.  I just placed in on here for a reference.  My php code [...]]]></description>
				<content:encoded><![CDATA[<p>This is a project for a class.  I&#8217;m unable to figure it out and I&#8217;m at my wits end.  I&#8217;m not asking for someone to do the project to me, just tell me where my coding is wrong.  My html form is correct.  I just placed in on here for a reference.  My php code seems to work until I get to the // Split a string into an index array.  Any help would be greatly appreciated.</p>
<p>When I try to run the program through WAMP I get an error:</p>
<p><b>Parse error</b>:  parse error in <b>C:wampwwwOswaltPatricia_Unit4AssignmentSaveDirectory.php</b> on line <b>53</b></p>
<p>Line 53 is:<br />
$Contacts = &#8220;$LastName;$FirstName;$StreetAdd;$City;$State;$ZipCode;$AreaCode;$PhoneNum&#8221;;</p>
<p><b>InputTelephone.html</b></p>
<pre>
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;

&lt;html&gt;
    &lt;!--Patricia Oswalt - IT250 Unit 4 Assignment--&gt;
    
    &lt;head&gt;
        &lt;title&gt;Telephone Directory Input&lt;/title&gt;
    &lt;/head&gt;
     
    &lt;body&gt;
        &lt;h1&gt;New Directory Listing&lt;/h1&gt;
        &lt;form action="SaveDirectory.php" method="post" enctype="application/x-www-form-urlencoded"&gt;
            &lt;p&gt;Last Name &lt;input type="text" name="LastName" size="30" tabindex="1" /&gt;
            First Name &lt;input type="text" name="FirstName" size="20" tabindex="2" /&gt;&lt;/p&gt;
            &lt;p&gt;Street Address &lt;input type="text" name="StreetAdd" size="50" tabindex="3" /&gt;&lt;/p&gt;
            &lt;p&gt;City &lt;input type="text" name="City" size="30" tabindex="4" /&gt;
            State (Abbr) &lt;input type="text" name="State" size="2" tabindex="5" /&gt;
            Zip Code&lt;input type="text" name="ZipCode" size="5" tabindex="6" /&gt;&lt;/p&gt;
            &lt;p&gt;Area Code (&lt;input type="text" name="AreaCode" size="3" tabindex="7"/&gt;)
            Phone Number &lt;input type="text" name="PhoneNum" size="8" tabindex="8" /&gt;&lt;/p&gt;
            &lt;p&gt;&lt;input type="submit" value="Save" tabindex="9" /&gt;&lt;input type="reset" tabindex="10" /&gt;&lt;/p&gt;
        &lt;/form&gt;
        &lt;p&gt;&lt;a href="InputTelephone.html"&gt;Add New Listing&lt;/a&gt;&lt;/p&gt;
        &lt;p&gt;&lt;a href="contactlist.txt"&gt;Retrieve Contact List&lt;/a&gt;&lt;/p&gt;
    &lt;/body&gt;

&lt;/html&gt;
</pre>
<p>SaveDirectory.php</p>
<pre>
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;

&lt;html&gt;
    &lt;!--Patricia Oswalt - IT250 Unit 4 Assignment--&gt;
    
    &lt;head&gt;
        &lt;title&gt;Save Directory&lt;/title&gt;
    &lt;/head&gt;
     
    &lt;body&gt;

        &lt;?php
        
        //initializing the variables
        $LastName = ($_POST['LastName']);
        $FirstName = ($_POST['FirstName']);
        $StreetAdd = ($_POST['StreetAdd']);
        $City = ($_POST['City']);
        $State = ($_POST['State']);
        $ZipCode = ($_POST['ZipCode']);
        $AreaCode = ($_POST['AreaCode']);
        $PhoneNum = ($_POST['PhoneNum']);
            
        //confirming that all variables will contain values
        if (empty($LastName) ||
            empty($FirstName) ||
            empty($StreetAdd) ||
            empty($City) ||
            empty($State) ||
            empty($ZipCode) ||
            empty($AreaCode) ||
            empty($PhoneNum))
            echo "&lt;p&gt;You must completely fill out the form.  Please use your browser's Back button to return to the form.&lt;/p&gt;";

        else 
        //creating, writing and saving to the text file.
        $NewContact = 'contactlist.txt';
        $Contact = fopen($NewContact, 'a+');
        $output ="n $LastName n";
        $output ="n $FirstName n";
        $output ="n $StreetAdd n";
        $output ="n $City n";
        $output ="n $State n";
        $output ="n $ZipCode n";
        $output ="n $AreaCode n";
        $output ="n $PhoneNum n";
        echo "New Contact Saved Successfully!";
        fwrite($Contact, $output);
        fclose($Contact)

    // Split a string into an index array
        $Contacts = "$LastName;$FirstName;$StreetAdd;$City;$State;$ZipCode;$AreaCode;$PhoneNum";
        $ContactsArray = explode(";", $Contacts);
        echo "&lt;br&gt;&lt;strong&gt;Contact List&lt;/strong&gt;&lt;br&gt;&lt;br&gt;";
        for($i=0; $i&lt;count($ContactsArray); $i++) {
             echo "$ContactsArray[$I]&lt;br&gt;";
         }
    // Sort an index array
        sort($ContactsArray);
        echo "&lt;br&gt;&lt;strong&gt;Sorted Contact List&lt;/strong&gt;&lt;br&gt;&lt;br&gt;";
        foreach($ContactsArray as $Contacts) {
           echo "$Contacts&lt;br&gt;";
           }
    
        ?&gt;

    &lt;/body&gt;

&lt;/html&gt;
</pre>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/parsing-error-in-a-class-project-cant-figure-it-out/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>student details using c++</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/student-details-using-c-plus-plus/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/student-details-using-c-plus-plus/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 12:59:24 +0000</pubDate>
		<dc:creator>Spoinkgeek</dc:creator>
				<category><![CDATA[Arrays (programming)]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Software development]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[struct record { int ID; string name; string nationality; bool IsMale; }ExampleStudent; [/pre] this is what i can do so far to declare it variables.i need insert new record, delete and sort the record. so, what are the next steps? kindly show me the codes. much appreciated. this is for my knowledge. i want to [...]]]></description>
				<content:encoded><![CDATA[<pre>struct record
{
           int ID;
           string name;
           string nationality;
<pre>           bool IsMale;
}ExampleStudent;</pre>
<p>[/pre]<br />
this is what i can do so far to declare it variables.i need insert new record, delete and sort the record. so, what are the next steps? kindly show me the codes. much appreciated. this is for my knowledge. i want to learn. thanks.[/pre]</p>
<p>[/pre]</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/student-details-using-c-plus-plus/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>array</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/array-2/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/array-2/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 10:51:17 +0000</pubDate>
		<dc:creator>Apac</dc:creator>
				<category><![CDATA[Arrays (programming)]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[write a c++ program to remove all duplicates from an array list if the given array list is:- 1, 2, 3, 3, 3,4,4,4,4,9,11,14,14,14 the resultant array list is:- 1,2,3,4,9,11,14]]></description>
				<content:encoded><![CDATA[<p>write a c++ program to remove all duplicates from an array list if the given array list is:-</p>
<p>1, 2, 3, 3, 3,4,4,4,4,9,11,14,14,14<br />
the resultant array list is:-<br />
  1,2,3,4,9,11,14</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/array-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vb.Net Image List</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/vbnet-image-list/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/vbnet-image-list/#comments</comments>
		<pubDate>Fri, 30 May 2008 23:53:27 +0000</pubDate>
		<dc:creator>Surfdog</dc:creator>
				<category><![CDATA[Arrays (programming)]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I am Trying to build a game that uses arrays to select an image from an image list. when i run the game, i get an image in the image box, but it keeps cycling through all three options. the code so far is: Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles [...]]]></description>
				<content:encoded><![CDATA[<p>I am Trying to build a game that uses arrays to select an image from an image list. when i run the game, i get an image in the image box, but it keeps cycling through all three options.</p>
<p>the code so far is:</p>
<p>Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick<br />
        Dim flagRight As Integer = 0<br />
        Dim flagLeft As Integer = 0<br />
        Dim I, J As Integer<br />
        Do Until flagRight = 1<br />
            I = Int(Rnd() * 3)<br />
            picRight.Image = imlRight.Images(I)<br />
            flagRight = 1<br />
        Loop<br />
        Do Until flagLeft = 1<br />
            J = Int(Rnd() * 3)<br />
            picLeft.Image = imlLeft.Images(J)<br />
            picRight.Visible = True<br />
            flagLeft = 1<br />
        Loop</p>
<p>Can anyone help</p>
<p>thanks a lot</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/vbnet-image-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/30 queries in 0.037 seconds using memcached
Object Caching 790/910 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-24 10:13:35 -->