#include <iostream>
using namespace std;
// Basic structure, containing only two elements of type int
// We use the word "struct" to define structure
// After the word struct we write the name of our structure
// By default we should begin names of structures with upper case
struct Point {
int x;
int y;
};
int main() {
// After creating the structure we can use it as a new type for our variables
// Now we create variable named "point" of type Point
Point point;
// We assign new value to our point variable
// We assign values to the corresponding fields of the Point structure
// 5 is assigned to the first field in the structure - x
// 3 is assigned to the second field in the structure - y
cout << "Creating new point with x = 5 and y = 3" << endl;
point = {5, 3};
// To access the field from our variable of type Point we write: variable_name.field_name
// For example to access the field x: point.x
cout << "Point x: " << point.x << endl;
cout << "Point y: " << point.y << endl;
// We can also assign new values to fields this way
cout << endl << "Assigning new values to the point variable" << endl;
point.x = 20;
point.y = 13;
cout << "Point x: " << point.x << endl;
cout << "Point y: " << point.y << endl;
return 0;
}