プログラミング言語C言語でHelloWorldをする方法について紹介します。
C言語スクリプトのファイル (hello.c)
#include <stdio.h>
int main(int argc, char *args[])
{
printf("Hello, world!\n");
return 0;
}
コンパイル
gcc -o hello hello.c
gcc hello.c -o hello.exe
実行
./hello
コマンドライン
cat << EOT > hello.c #include <stdio.h> int main(int argc, char *args[]) { printf("Hello, world!\n"); return 0; } EOT gcc -o hello hello.c gcc hello.c -o hello.exe ./hello # => helloWorld!