Hello everyone.
I have this question. What is the difference between a char array and a string?
From what i understand so far a char is a different data type than a string but i get confused by reading that a char array that is null terminated is a string of chars.
So what is the real difference ?
Is a null terminated char array the same thing with a data type string ?
I have read that strings consume alot more memmory than char arrays but i fail to see the difference between the two...
Also i have read that the compiler will automatically terminate a char array if there is enough space for a /0. If i manually null terminate my char array and there is still space left will the compiler fill the "empty" space with /0 characters ? if i write this
char testchars [10] = {'t', 'e', 's', 't', '/0'};
Also is this considered manually terminated or wil the compiler read the /0 as two different bytes in the below code and will automatically add the /0 termination after ?
char testchars [10] = {"test/0"} ;
Thank you in advance !!!