Image

Imageataxi wrote in Imagecpp

Use of struct and class keywords in parameter lists

What is the practical difference between declaring func as

    func(struct point p)

as below and declaring it as

    func(point p)
if any?


Just point me at a useful reference on this if you know of one ...


#include <iostream>
struct point
{
	point(int a, int b):x(a), y(b){};
	int x;
	int y;
};

int func(struct point p)
{
	return p.x + p.y;
}

int main()
{
	point p(2,2);
	std::cout << func(p) << std::endl;
	return 0;
}