0

Why my doesn't print the size of string array?

https://code.sololearn.com/c5Mu93LXxeu1/?ref=app I try to split string with delimeter and I try it with string array. But something is not correct. Need your help.

11th Jul 2022, 6:59 PM
TeaserCode
4 Respuestas
0
a1 is an array there, not string.. You can print array size by using cout << (sizeof(a1) /sizeof(a1[0])) ;
11th Jul 2022, 7:17 PM
Jayakrishna 🇮🇳
0
Yes, but I want to split string a into chunks. Or how to do it. Why it is not possible with a1.size()?
11th Jul 2022, 7:22 PM
TeaserCode
0
a1 is an array and array don't have a method size(). You are splitting string 'a' into length 6 string in array a1, check this by cout<< a1[b-1] << endl; inside outer loop.. After end of inner loop. and size can determined by above previouly posted formula.
11th Jul 2022, 7:36 PM
Jayakrishna 🇮🇳
0
What is the goal of the code? how you'd like to split the string, and how the expected result should be?
12th Jul 2022, 3:37 AM
Ipang