+ 1
Ocupa más memoria el caracter 'a' que el string "a"?
4 odpowiedzi
+ 3
strings manage char arrays for you. That's all they're doing.
0
SIP. Por ser un puntero a char...
Probé ejemplo y uno ocupa 1 Byte y el otro 4. Gracias
0
sizeof("a") is 2 instead of 1. That's because of the '\0' character which terminates string literals in memory.
Note that "a" is a char[2] and not a char*.
0
Thanks Timon. But i have a dude.
https://stackoverflow.com/questions/1287306/difference-between-string-and-char-types-in-c
strings are not char array, right?
Are a class related with array but asigned like a pointer? 😕😑
I am confused. Thanks in advance...