I am (very) new to C ++ and am having trouble understanding structures. I use the sample code from the course, so I have:
struct Point { int x; int y; }
In another bit of code, I want to write the following:
drawLine(point1, new Point(x, y));
This does not work, and I understand that I am trying to declare a structure as if it were a class, but is there a way to do this? Currently, I have written a helper function that returns a point from x, y, but this seems to be roundabout.
source share