in the String class for java, I believe there is a function .toChar() or something. Well what that does is it turns the String into a char
A string in C, is comprised of just an array of characters, there is no class in C.
>Terminated by a NULL character ('\0')
>Without the NULL character, it is just an array of characters, C will not recognize it as a String without the NULL
if your a beginner to C, try to avoid dynamic strings (strings where you change the size of it)
and go ahead and be wasteful of memory like
and to use strings, you can't just say
myStr = "hi";
there is a function in string.h to assign Literal strings (strings int he quotes) to the character array
lets say you allocate some memory for a string and then you want to put Hello world in it, you can do this many ways, here are some:
int strcpy(char* destination, char* cpyString);
just remember that arrays are treated as pointers and similar. Please read the FAQ for more details.
char *str = "Hello, World\n";
char str = "Hello, World\n";