Structs – real life examples? [closed]

Well a class would still work for it, but an example I could think of is something like a Point. Assuming it is an x and y value, you could use a struct.

struct Point {
    int x;
    int y;
}

In my mind, I would rather have a more simple representation of a pair of integers than to define a use a class with instantiations when the actual entity does not really have much(or any) behavior.

Leave a Comment