0

I want to assigne value to string array but i dont know the size of the array from start... Is there any way to do it
Programatically

for(int i=0 ; i < unkownSize; i++)
string[i] = some value

I hope my question is clear.

2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by NormR1
1

It is not possible to change the size of an array. I recommend that you use an aray list if you don't know what the size is to be.
Otherwise, define a new array with the desired size and copy the contents of the old array to it (see Arrays class for a utility to do this), then assign the old variable to the new array.

Edited by NormR1

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.