like in a integer array if we dont know the size of array we write…
int n;
cin>>n;
int a[n];
this is what array is declared when we dont know the size.
so if we dont know the string size how can we initialize…
in online ide like hacker rank…
like in a integer array if we dont know the size of array we write…
int n;
cin>>n;
int a[n];
this is what array is declared when we dont know the size.
so if we dont know the string size how can we initialize…
in online ide like hacker rank…
It is not required in string.
Use an Stl string (not the C style array of characters) as it is more flexible to work with
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.