Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
g++ の -DN フラグを使用して、コンパイル中に C++ プログラムに値を設定できると聞きました。誰でも方法を説明できますか? ありがとうございました
-DXXXflag は を追加するのと同じ#define XXXです。のよう-DN=2です#define N 2。
-DXXX
#define XXX
-DN=2
#define N 2
また、このフラグを使用して、コンパイル中に値を渡すことができます。
参照: