Saturday, March 27, 2010

Adding values to a C# array

Programmer Question

Probably a really simple one this - I'm starting out with C# and need to add values to an array, for example:



int[] terms;

for(int runs = 0; runs < 400; runs++)
{
terms[] = value;
}


For those who have used PHP, here's what I'm trying to do in C#:



$arr = array();
for ($i = 0; $i < 10; $i++) {
$arr[] = $i;
}


Thanks,
Ross



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails