Turning variables and expressions into strings - C++ Data Type

C++ examples for Data Type:string

Description

Turning variables and expressions into strings

Demo Code

#include <iostream>
using namespace std;
#define P(A) cout << #A << ": " << (A) << endl;
int main() {//from   w  w  w.  j  a va 2s.  co m
   int a = 1, b = 2, c = 3;
   P(a); P(b); P(c);
   P(a + b);
   P((c - a)/b);
}

Result


Related Tutorials