Re: why debug step by step, it s ok



baumann@pan wrote:
Hi all,


I have one simple program: #define __EXTENSIONS__ #include <stdio.h> #include <string.h>


int main() { char *buf="5/90/45"; char *token; char *lasts;


printf("tokenizing \"%s\" with strtok():\n", buf); if ((token = strtok(buf, "/")) != NULL) { printf("token = \"%s\"\n", token); while ((token = strtok(NULL, "/")) != NULL) { printf("token = \"%s\"\n", token); } } }

the program has abused the strok,  i know it,

******but why when  i `gdb prog_name`  and execute step by step , it 's
ok?

baumann here clearly states that he knows that the program is incorrect and the reason for it. Many of you reply as if he didn't know that. Please read the post before replying.



-- August .