Created
November 25, 2013 22:07
-
-
Save daemonfire300/7649797 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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