K
Kay
I have obtained whole sentence by using this. If the sentence like this
Sentence 1: Harry Protter; M; 15
Sentence 2: Peter Parker; M; 23
char wholeLine[45];
//obtain the whole string
fgets(wholeLine, 45, ptr);
how can I break up this sentence without storing the semi-colon and save
it into three different character array?
some one told me that it can be done by this
char rest_name[40];
rest_name = strtok( wholeLine, ';');
But It can't do it, anyone can guide me ? Thx
Sentence 1: Harry Protter; M; 15
Sentence 2: Peter Parker; M; 23
char wholeLine[45];
//obtain the whole string
fgets(wholeLine, 45, ptr);
how can I break up this sentence without storing the semi-colon and save
it into three different character array?
some one told me that it can be done by this
char rest_name[40];
rest_name = strtok( wholeLine, ';');
But It can't do it, anyone can guide me ? Thx