Sunday, August 2, 2009

How would i split a string into a char array in c++ ?

so i have asked the used to enter a word. Let's say they type in "baby"..how would I split it so that I can get an array with array1[b], array1[a], array2[b], array3[y]..thanx in advance

How would i split a string into a char array in c++ ?
http://en.allexperts.com/q/C-1040/Explod...
Reply:string str = "baby";


string arr [str.length];


for(int i=0; i %26lt; str.lenght; i++)


{


arr[i] = str[i];


}

daylily

No comments:

Post a Comment