Skip to content

Instantly share code, notes, and snippets.

@daemonfire300
Created November 25, 2013 22:07
Show Gist options
  • Save daemonfire300/7649797 to your computer and use it in GitHub Desktop.
Save daemonfire300/7649797 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
struct Point
{
int x;
int y;
};
double inc_and_add(Point& p)
{
p.x++;
p.y++;
return p.x + p.y;
}
int main()
{
Point p = {3,2};
cout << inc_and_add(p) << endl;
cout << p.x << " " << p.y << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment