Im unable to find the syntax errors

struct TwoVals
{
int x;
double y;
};

int main()
{
TwoVals.x = 10;
TwoVals.y = 20;

TwoVals vals;
cout << vals << endl;

return 0;

}
closed account (48T7M4Gy)
1
2
3
4
5
6
TwoVals vals; // declare variable vals of type TwoVals

vals.x = 10; // set value
vals.y = 20; // set value

cout << vals.x << ' ' << vals.y << endl;
Topic archived. No new replies allowed.