- ベストアンサー
プログラムを上手く動かすには…
与えられた文字列の文字を全て大文字に変換する関数letter2capを作成しなさい。関数letter2capではポインタを使用すること。 #include<stdio.h> #include<ctype.h> #define MAXCHAR 1024 void letter2cap ( char* ); int main( void ) { char str[MAXCHAR]; gets( str ); letter2cap( str ); printf("%sn",str); return 0; } void letter2cap( char* str) { while( *str ){ *str = toupper( *str ); } } 上手く動かすには何が足りないのでしょうか?
- みんなの回答 (3)
- 専門家の回答
質問者が選んだベストアンサー
その他の回答 (2)
- php504
- ベストアンサー率42% (926/2160)
回答No.2
- m-take0220
- ベストアンサー率61% (480/786)
回答No.1