[ create a new paste ] login | about

Link: http://codepad.org/GQ51MO4l    [ raw code | output | fork ]

C, pasted on Dec 4:
1
2
3
4
5
6
#include <string.h>
#include <stdio.h>
void parse(char*msg){char*c=strchr(msg,':');if(c) {*c=0;c++;} 
char*n=strtok(msg," ");while(n){puts(n);n=strtok(NULL," ");}
if(c){puts(c);}}
main(){char msg[]="sample : abcnsjd hajs";parse(msg);}


Output:
1
2
sample
 abcnsjd hajs


Create a new paste based on this one


Comments: