trthong95
7/4/2018 - 10:11 AM

String Split Applet split string with character

String Split Applet split string with character

//gcc 5.4.0

#include  <stdio.h>
#include <string.h>
int main(void)
{
    char str[50]="Hello, world!\n";
    char *ptr;
    ptr = strtok(str,",");
    printf("%s",ptr);
    return 0;
}
/* OUTPUT
Hello
*/