C言語で書くといろいろエラーがでます
C言語で書こうとすると色々エラーがでてしまいます。
C/C++は慣れが必要だなぁ。
ここ数日で遭遇したものは、
・ undefined reference to `関数名'
→ ヘッダファイルをincludeしていなかった。。
・ redeclaration of `変数名'
→ 同じ変数名は再利用できないのですね > C言語。。
http://flute.u-shizuoka-ken.ac.jp/~s-okubo/class/language/ref/error.html
・Conversion from ‘Foo*’ to non-scalar type ‘Foo’ requested
→ new Foo で返ってくるのは、ポインタですね。 > C++
http://cplusplus.syntaxerrors.info/index.php?title=Conversion_from_%E2%80%98Foo*%E2%80%99_to_non-scalar_type_%E2%80%98Foo%E2%80%99_requested
・deprecated conversion from string constant to 'char*'
→ C++の文字列リテラルは、文字配列へのポインタを返すのですね。char*でなくchar[] > C++
http://stackoverflow.com/questions/1524356/c-deprecated-conversion-from-string-constant-to-char