Created
June 23, 2012 05:16
-
-
Save abidrahmank/2976991 to your computer and use it in GitHub Desktop.
C++ code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
struct MyStruct | |
{ | |
int x; | |
}; | |
void updateStruct (MyStruct my_struct) | |
{ | |
my_struct.x = 10; | |
} | |
int main () | |
{ | |
MyStruct my_struct; | |
my_struct.x = 5; | |
updateStruct( my_struct ); | |
cout << my_struct.x << '\n'; | |
cin.get(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment