Already asked a similar question, but there was a need to transfer the string to the program at the compilation stage.
There is a code:
#ifdef VALUE std::cout << VALUE << std::endl; #endif // VALUE #ifndef VALUE char* VALUE = "not defined"; std::cout << VALUE << std::endl; #endif // !VALUE When compiled with a parameter
cl /DVALUE=100 core.cpp Everything works and the program produces a number. As I understand it, the / D key is an option only for numbers, is there a similar key for strings?
cl /DVALUE="some text" core.cpp? - Majestio-DVALUE='"a b"'g++ 1.cpp -DVALUE='"a b"' -o 11.cpp works for me on Linuxg++ 1.cpp -DVALUE='"a b"' -o 1- pavel