Why compiler is showing error: array must be initialized with a brace-enclosed initializer


HERE IS THE CODE

hi @hhiteshbansal_40d12e2460a1738e
refer this

HOW can we do it without using vectors

u can use array of string instead of vector as anyhow, u will have to store the strings and sort them…

Yes I did the same but i am not able to convert subsequence into string

hi @hhiteshbansal_40d12e2460a1738e
i suggest u to go and have a basic understanding of vectors… this code will seem very easy to u…

yes but can you tell me my mistake in my code

share ur code then…


HERE is my code

please tell what is my mistake in the above

hi @hhiteshbansal_40d12e2460a1738e
ur code wont work only… u are trying to store char array in string array… how is that possible… refer my code i sent…

ok is there no way to use string instead of vectors

u can do, but that would be a long task… as u used char array, u will have to convert that to string, then add it to array… also u would have to maintain a count variable over there… so vector eases that thing…

okay thanks got it :+1:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

Hi @hhiteshbansal_40d12e2460a1738e
Do u still have any doubt?? U have reopened the doubt…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.