>>817 座標(cx, cy)を半径rで回るとすると int i = 0; while (true) { i = (i + 1) % 360; double rad = (double) i * 3,14 / 180; double x = cos(rad) * r; double y = sin(rad) * r; drawImage(cx + x, cy + y); }
class Block struct Obj class Block class Step class Block class Block class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * int * 1 class Block class Step class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * int * 0
>>832 >18.5.1 >1. The class type_info describes type information generated by the >implementation. Objects of this class effectively store a pointer to >a name for the type, and an encoded value suitable for comparing two >types for equality or collating order. The names, encoding rule, and >collating sequence for types are all unspecified and may differ >between programs. > >bool before(const type_info& rhs) const; > >5. Effects: Compares the current object with rhs. >6. Returns: true if *this precedes rhs in the implementation’s collation order.
さらに追加です。以下のコードで実行した場合の出力を書きます。 <C++> int main(){ int h = 0; int i = 0; int j = 0; int k; printf("%d ", h++); printf("%d ", i = i++); printf("%d ", k = j++); printf("%d\n", i); return 0; } <C#> static void Main(string[] args) { int h = 0; int i = 0; int j = 0; int k; Console.Write("{0} ", h++); Console.Write("{0} ", i = i++); Console.Write("{0} ", k = j++); Console.WriteLine("{0}", i); } 出力 <C++> 0 0 0 1 <C#> 0 0 0 0
%cat auto.cpp int main(){ auto i = 0; return i; } %g++ -Wall auto.cpp auto.cpp: In function `int main()': auto.cpp:2: error: ISO C++ forbids declaration of `i' with no type
autoの仕様変わるの? auto i = 0; // type-specifier auto int i = 0; // storage-class-specifier type-specifier auto auto i = 0; // storage-class-specifier type-specifier 名前に意味ダブらすの得意だし>C++
だから、そもそも3番目はエラーだってば。 >cl auto.cpp Microsoft(R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86 auto.cpp(2) : error C4430: 型指定子がありません - int と仮定しました。メモ: C++ は int を既定値としてサポートしていません