constants
public cpp v1 · immutable#include <iostream>int main(int argc, char *argv[]){ // Our two variables. One is constant, one is not. int sample1 = 50; const int sample2 = sample1; // Here we attempt to swap out the values of the two... // Even though they hold the same value. const int sample3 = sample1; sample1 = sample2; sample2 = sample3; // Here's a simpler way than using cin.ignore... system("PAUSE"); return 0;}