#include<string.h>
#include<stdio.h>
void main()
{
char *str1="hello";
char *str2="world";
strcat(str2,str1);
printf("%s",str2);
}
このプログラムを実行すると、ランタイム プログラムが終了します。
私を助けてください。
私がこれを使用する場合:
char str1[]="hello";
char str2[]="world";
それは働いています!
しかし、なぜ
char *str1="hello";
char *str2="world";
このコードは機能していません????