C++ storing #define as std::string would give size as zero compile time
I am new to C++, stuck with strange problem. I have a macro
#define TEXT_VALUE "Alpha" in common.h file
In a method inside program.cpp i want to access the same and want to do
something like below
std::string test_value = TEXT_VALUE
if(test_value.empty()) {//check during compile time if not set then set
to default
test_value = "Beta";
}
But test_value is always set as "Beta" in generated executable... even
though common.h has the macro.... if the above is not correct way to do
it...any other alternative? Thanks in Advance
No comments:
Post a Comment