2014-08-29から1日間の記事一覧
一時的にオブジェクトを作って渡すとき、C++ならいちいちnewとかせずに引数の中で使い捨てできる。 #include <stdio.h> class Pos_t { public: int x; int y; }; void show(const Pos_t &A) { printf("X=%d\n",A.x); printf("Y=%d\n",A.y); } int main() { printf("初</stdio.h>…
一時的にオブジェクトを作って渡すとき、C++ならいちいちnewとかせずに引数の中で使い捨てできる。 #include <stdio.h> class Pos_t { public: int x; int y; }; void show(const Pos_t &A) { printf("X=%d\n",A.x); printf("Y=%d\n",A.y); } int main() { printf("初</stdio.h>…