C言語なら俺に聞け(入門編)Part 102
■ このスレッドは過去ログ倉庫に格納されています
0233220
2012/06/10(日) 16:14:00.88char kotoba[100] = "\0";
char gobi[2] = "\0";
int i = 0;
scanf ("%s",kotoba)
i = strlen(kotoba);
strcat (gobi,&kotoba[i-2]);
strcat (gobi,&kotoba[i-1]);
if(strcmp(gobi,"あ") == 0)
{printf ("い")}
どこが違うのでしょうか?
gobiを出力してみると目的の字の後に半角文字が出力されています
なぜgobiに2バイト文字+1バイト文字?が入ることが出来るのでしょうか?
■ このスレッドは過去ログ倉庫に格納されています