How do I concatenate two strings in C?

后端 未结 11 1030
春和景丽
春和景丽 2020-11-22 16:00

How do I add two strings?

I tried name = \"derp\" + \"herp\";, but I got an error:

Expression must have integral or enum type

11条回答
  •  心在旅途
    2020-11-22 16:51

    You should use strcat, or better, strncat. Google it (the keyword is "concatenating").

提交回复
热议问题