// test_parameters.cpp void funct1(int i_input, // local copy of value int * i_ptr, // local copy of pointer const int * i_const_ptr, // can't change object int * const i_ptr_const, // can't change local pointer const int * const i_ptr_const_const,// just no changes int & ref, // pass by reference const int & const_ref) // just no changes { i_input = 12; // local copy set to 12 *i_ptr = 13; // changes value in main // *i_const_ptr = 14; // can not change *i_ptr_const = 15; // changes value in main // *i_ptr_const_const = 16; // can not change ref = 17; // const_ref = 18; // can not change } #include using namespace std; int main() { int i2 = 2; int i3 = 3; int i4 = 4; int i5 = 5; int i6 = 6; int i7 = 7; int i8 = 8; const int ic6 = 6; cout << "test_parameters running" << endl; funct1(i2, &i3, &i4, &i5, &i6, i7, i8); cout << "i2=" << i2 << endl; cout << "i3=" << i3 << endl; cout << "i4=" << i4 << endl; cout << "i5=" << i5 << endl; cout << "i6=" << i6 << endl; cout << "i7=" << i7 << endl; cout << "i8=" << i8 << endl; cout << "test_parameters finished" << endl; return 0; } // Output from execution is: // test_parameters running // i2=2 // i3=13 // i4=4 // i5=15 // i6=6 // i7=17 // i8=8 // test_parameters finished