0
How we use sizeof in string?
3 Antworten
+ 2
C++ :
Using sizeof with a string results in the size of whole string.
Example:-
char str[10]="Sololearn";
cout<<sizeof(str);
Output will be 10 (one character occupies 1 byte, so a 10 character string will be of 10 bytes)
🤟
0
👍👍👍
0
int sizeOfStr = sizeof(str) / sizeof(char);