hey i have a 2D char array x[5,5]. now i have to convert each row into a string for some manipulation. i have tried this one but returned errors.
for (int i = 0; i < 5;i++ ){
string str= new string( x[i, j] );
}
thanks
hey i have a 2D char array x[5,5]. now i have to convert each row into a string for some manipulation. i have tried this one but returned errors.
for (int i = 0; i < 5;i++ )}
thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Alok UniyalPosted Oct 23, 2012, 6:51 AM
Try this
for(int i=0;i<5;i++)
{
string str="";
for(int j=0;j<5;j++)
{
str+=x[i][j];
}
}
binod kmPosted Oct 23, 2012, 7:05 AM
Santhosh Kumar JayaramanPosted Oct 23, 2012, 6:56 AM
This strlist will be a list of string and it will hold all the 5 converted strings