All pastes #934918 Raw Edit

constants

public cpp v1 · immutable
#934918 ·published 2008-03-09 05:10 UTC
rendered paste body
#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;}