短いテキストを表示するプログラムを作りました。期待通りの表示にはなったのですが、コンパイル時に警告が出てしまいます。
![](/wp-content/include/images/avatar/teacher/5.png)
どこを修正すべきか分かりますか?
main.c
#include <stdio.h>
#include <stdlib.h>
void SayHello();
int main() {
SayHello();
return EXIT_SUCCESS;
}
void SayHello() {
puts("Hello!");
}
期待される実行結果
Hello!
![](/wp-content/include/images/avatar/student/9.png)
これって、ハローワールドをサブルーチンにしただけですよね。
![](/wp-content/include/images/avatar/teacher/2.png)
そうよ。でも警告が出るのよね。
![](/wp-content/include/images/avatar/student/7.png)
うーん、すごく単純なプログラムだと思うんだけどなぁ……。
![](/wp-content/include/images/avatar/teacher/7.png)
C++のコンパイラでは、同じプログラムでも警告されません。