Hi I have just begun experimenting with structures. I'm try to run a very basic programme in which two points in a struct (x,y) are outputted by a function. I know it's very basic but Ive been trying all day and just can't figure it out. Any help would be greatly appreciated!
using namespace std;
void printPoint(const pointType& point);
struct pointType
{
int x;
int y;
}
int _tmain(int argc, _TCHAR* argv[])
{
struct pointType pos1;
pos1.x = 10;
pos1.y = 15;
printPoint();
system("pause");
return 0;
}
void printPoint(const pointType& point)
{
//
}
intfrom a function? Take that, and modify it so it works with yourstruct.printf("%d", point->x)inside your function?operator<<for iostreams, and use it withstd::cout, a simpler way is to access the members directly.