Skip to content

Instantly share code, notes, and snippets.

@gpetuhov
Last active March 17, 2017 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gpetuhov/169c61dc017f238ecac831b4177c9040 to your computer and use it in GitHub Desktop.
Save gpetuhov/169c61dc017f238ecac831b4177c9040 to your computer and use it in GitHub Desktop.
C++ Struct example
struct my
{
int a, b;
} m1;
int func(my f)
{
return f.a + f.b++;
}
int main()
{
m1.a = 5; m1.b = 10;
cout << func(m1) << endl; // Result is 15
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment