Re: another array question
string comprised \0.
Kuphryn
Re: another array question
Re: another array question
[ Moved thread ]
To 1821. Please post your array or not related questions in the appropriate forum!
Thanks!
Re: another array question
Quote:
Originally Posted by 1821
if i had a char array which was char example [100];
and it contained "hello" would hello be classed as a string even though its in a char array?
In C, the notion of string is not directly supported by the compiler...
A C-style string is only a pointer to a char, such as this char is immediately followed by another char, which itself is followed by another char, up to a '\0' char.
So, we can say that a pointer to the first char of a char[100] array, which contains various characters and a nul terminator, is a string.
But, in reality, where chars of a string are stored doesn't matter for all string-manipulating functions.