当 char* message="$GPGSV,2,1,07,07,79,048,42,02,51,062,43,26,36,256,42,27,138,42*71";
parse(message);就会core dump;
如果
char message[]="$GPGSV,2,1,07,07,79,048,42,02,51,062,43,26,36,256,42,27,138,42*71";
就正常了。+
void parse( char* message )
{
char *pch;
//char *message1="hello-world";
printf( "can parse\n" );
pch = strtok( message,",*");
printf( "over" );
while( pch != NULL ){
printf( "%s\n", pch);
pch= strtok( NULL ,",*");
}
}
|
阅读(1882) | 评论(0) | 转发(0) |