The function called at program startup is named main. The implementation declares no
prototype for this function. It shall be defined with a return type of int and with no
parameters:
int main(void) { /* ... */ }
or with two parameters (referred to here as argc and argv, though any names may be
used, as they are local to the function in which they are declared):
int main(int argc, char *argv[]) { /* ... */ }
or equivalent; or in some other implementation-defined man
内容がちゃんとしてればそれでよし (スコア:1)
体裁がどんだけ際物だろうとも、 おかしな間違いや嘘が無く、 C言語の解説として「ちゃんと」してれば、 いいんじゃないかな。
逆に言えば、 そこが駄目ならそれこそお話にならない わけだけど。
Re:内容がちゃんとしてればそれでよし (スコア:1)
予告編のFlashを見てみましたが
いきなり
2. おまじないの後にvoid main()と書く
ですよ...。
Re:内容がちゃんとしてればそれでよし (スコア:1)
最初からキチンと書いた入門書は見たことが無いです。
後で関数を扱う時に説明しても問題ないと思いますし
そのほうが、理解しやすいのでは?と思います。
printfに関しても同じ。
# #includeも同じ
コメントインがわかりにくい(笑)
Re:内容がちゃんとしてればそれでよし (スコア:1)
「おまじない」のことではなく、void main のことを言っているのでしょう。
int main(void)ならいいが、void main()ではいわゆるANSI C準拠じゃないので。
まあ、そのレベルの作者だということで期待はもてませんね、ってこと。
It's not who is right, it's who is left.
Re:内容がちゃんとしてればそれでよし (スコア:1, 興味深い)
C99を確認してくださいな。
ほい (スコア:0)
5.1.2.2.1 Program startup
The function called at program startup is named main. The implementation declares no prototype for this function. It shall be defined with a return type of int and with no parameters:
or with two parameters (referred to here as argc and argv, though any names may be used, as they are local to the function in which they are declared):
or equivalent; or in some other implementation-defined man