strcat segmentation fault

前端 未结 7 1821
后悔当初
后悔当初 2021-01-24 01:50

The second call to strcat here is generating a segmentation fault, why?

#include 
#include
#include 

        
相关标签:
7条回答
  • 2021-01-24 02:11

    whitespaceseparator isn't big enough to contain the concatenated string, so you're causing undefined behaviour.

    Using gets is normally frowned upon, too.

    0 讨论(0)
提交回复
热议问题