Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
passing by reference vs passing by value
//Title of this code #include <iostream> using namespace std; int main() { int x = 0, *y = 0, z = 0; cout << "Initial values: x = " << x << " y = " << y << " z = " << z << endl; x = 315; y = &x; z = x; cout << endl << "x = " << x << endl; cout << "y = " << *y << endl; cout << "z = " << z << endl; // change the value of x from 315 to 2; x = 2; cout << "\nx = " << x << endl; cout << "z = " << z << endl; cout << "y = " << *y << endl; }
run
|
edit
|
history
|
help
0
My First Wall
3 and 7 in a row
lambda demo
Breakfast Function
Hello World
CodeForces Div 3 - D
Arithemetic operators
project
11340 v3.0
4149 coj TL