検索結果 1 件

by kouki2299
1年前
フォーラム: C言語何でも質問掲示板
トピック: 何故、引数にconstがついているのか
返信数: 2
閲覧数: 8419

何故、引数にconstがついているのか

はじめまして
ある試験のサンプル問題を解いていたのですが、

char *func_c(char *s1, const char *s2)
{
char *s3 = s1;
for ( ; *s2; s2++ )
*s1++ = *s2;
*s1 = '¥0';
return s3;
}
解答群
ア strcat イ strchr ウ strcmp エ strcpy オ strlen

という問で引数char*s2にconstがついているのはなぜでしょうか?

詳細検索ページへ移動する