「C言語」引数、戻り値なしの関数を呼び出すサンプル
構文
main() {
void 関数名();
}
サンプルコード
#include <stdio.h>
void testfunc(void){
printf("this is a test!\n");
}
int main(void){
/* 関数の呼び出し */
testfunc();
return 0;
}
#include <stdio.h>
void testfunc(void){
printf("this is a test!\n");
}
int main(void){
/* 関数の呼び出し */
testfunc();
return 0;
}
#include <stdio.h> void testfunc(void){ printf("this is a test!\n"); } int main(void){ /* 関数の呼び出し */ testfunc(); return 0; }
実行結果
this is a test!