KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to print out to console using a macro the variable name for display members value while debugging ( logging ). How to do that? I tried the following but it doesnt' work. #define MY_PRINT(x) std::cout << "'x'=" << x << std::endl; int main(){ int my_variable=3; MY_PRINT( my_variable ); // I would like to print to console // 'my_variable'=3 }
Tags (comma-separated)
Save Edits
Cancel