Hi,
I am relatively new to programming.
I want to give out a simple Coordinstion system
on the console with one Point in it.
So i would ask the user to give me an x and y point
And put that in to the coordination system.
My Problem is i dont know how to make a coprdination system.
Do i have to use a nested vector ?
If i do that wont be all the "empty" spaces 0, so i would have a coordination system full of 0's and then an x on the point. Is there a way to do that
with out the 0's so the rest of the coordination system should just be empty.
#include <iostream>
#include <vector>
struct Coordinste {
int x;
int y;
};
int main()
{
std::vector<Coordinste> coordinates;
{
std::cout << "enter x y point: ";
int x;
int y;
std::cin >> x >> y;
coordinates.push_back({x, y});
}
// you now have one coordinate (x, y) point stored.
// The rest of it doesn't exist, therefore is empty.
}