Segmentation Fault when using strtok_r

后端 未结 6 984
野的像风
野的像风 2020-12-14 02:55

Can anyone explain why I am getting segmentation fault in the following example?

#include 
#include 

int main(void) {
  char          


        
6条回答
  •  再見小時候
    2020-12-14 03:34

    strtok_r tries to write null characters into hello (which is illegal because it is a const string)

提交回复
热议问题