GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


generic variables by baldurk
1
 
Variable var;
 
var = 3;
cout << "var: " << var << endl;
var = 3.1415926535f;
cout << "var: " << var << endl;
var = "PI!";
cout << "var: " << var << endl;
var[0] = 3;
var[1] = 3.1415926535f;
var[2] = "PI!";
cout << "var: " << var << endl;
var[3][0] = 3;
var[3][1] = 3.1415926535f;
var[3][2] = "PI!";
cout << "var: " << var << endl;

/*
Output:var: 3
var: 3.14159f
var: "PI!"
var: Array { [0]=3 [1]=3.14159f [2]="PI!" }
var: Array { [0]=3 [1]=3.14159f [2]="PI!" [3]=Array { [0]=3 [1]=3.14159f [2]="PI!" } }
*/