CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Struct Member Update

C++ code walkthrough · Question 44
easyStructs

Code

Read carefully. What does this print?
1#include <iostream>
2using namespace std;
3struct Point { int x, y; };
4int main() {
5 Point p = {3, 4};
6 p.x += p.y;
7 cout << p.x << " " << p.y << endl;
8 return 0;
9}

Your answer