x-ite's diary

覚え書きです。想定読者は俺

2011-05-01から1ヶ月間の記事一覧

C++で親のプロパティを子が間違えて再定義する場合にハマる

class Circle { public: float x, y; float radius; Circle(); Circle(float x, float y, float radius); }; Circle::Circle() { x = 0.0f; y = 0.0f; radius = 1.0f; } Circle::Circle(float x, float y, float radius) { this->x = x; this->y = y; this->…

"_OBJC_CLASS_$_AVAudioPlayer", referenced from:

"_OBJC_CLASS_$_AVAudioPlayer", referenced from: FrameworksにAVFoundation.frameworkを追加

相互インクルードによるコンパイルエラー

ISO C++ forbids declaration of 'Hoge' with no type expected `;' before '*' token 'Hoge' has not been declared cannot convert 'Hoge*' to 'int*' in argument passing 上記のエラーがでた場合は、相互参照によるクラスのコンパイルエラーの可能性があ…

cppファイルのそれぞれの行数を見るワンライナー

find . -name "*\.cpp" |xargs wc -l |lv

python 特定ファイルまでの絶対パス

import os os.path.abspath(os.path.dirname(__file__))