Hello, im trying to compair a text BEFORE a space is giving..
strcmp(msg, "/name") for example..
/name Hanno
how can i split /name and Hanno ?
in php there is a function called explode.. but isnt realy usefull this time :(
Hope someone got the right experiance to show me an example.
Best regards,
Hanno
Use strchr() to find the space:
char* pos = strchr(str, " ");
I managed to get it working with comparing:
if (!strncmp (msg,"/panelty",8))
strncpy can copy characters from a string, but how can i manage to copy character 9 to 20 in the string ?