How do u store make a string with letters to null ? strcpy(word, 0) ?
Also also do u detect if the string is null?
How do u store make a string with letters to null ? strcpy(word, 0) ?
Also also do u detect if the string is null?
>How do u store make a string with letters to null ?
>Also also do u detect if the string is null?Code:word[0] = '\0';
Code:if ( word[0] == '\0' ) ...
My best code is written with the delete key.
I was thinking of something like this
But I guess your way works if you don't need to ensure everything in the array is null, I always over complicate things.Code:#include <string.h> */..../* memcpy(string, 0, sizeof string);
Help populate a c/c++ help irc channel
server: irc://irc.efnet.net
channel: #c
Code:memset(mystring, '\0', sizeof(mystring));
err, what if string is defined as followsOriginally Posted by chrismiceli
Code:char *string="Hello World";
The one who says it cannot be done should never interrupt the one who is doing it.
>err, what if string is defined as follows
Then any attempt to modify it results in undefined behavior.
My best code is written with the delete key.