Skip to content

Instantly share code, notes, and snippets.

@abidrahmank
Created June 23, 2012 05:16
Show Gist options
  • Save abidrahmank/2976991 to your computer and use it in GitHub Desktop.
Save abidrahmank/2976991 to your computer and use it in GitHub Desktop.
C++ code
#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