DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Print Variable Macro
A simple macro to print out a variable in c++
Usage:
int x = 5;
string myString = "hello";
prt(x);
prt(myString);
Output:
x = '5'
myString = 'hello'
#define prt(x) std::cout << #x " = '" << x << "'" << std::endl;





