Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

data type class and variable also a class. what does this mean?

48 views
Skip to first unread message

K' Dash

unread,
Nov 4, 2014, 4:39:02 AM11/4/14
to

GUID_address GUID::function(int x, int y)

what does this mean.

GUID_address is class name where GUID is also a class name. where function(int x, int y) exsit in GUID.h.
can any one explain it what is going on this line?

Martijn Lievaart

unread,
Nov 4, 2014, 5:40:13 AM11/4/14
to
This line by itself is meaningless. Maybe it looks like this?

GUID_address GUID::function(int x, int y)
{
// ... implementation here
}

In that case it is the definition of the class member function
GUID::function(int,int) declared in the header.

M4

FredK

unread,
Nov 4, 2014, 10:22:28 AM11/4/14
to
First of all, "function" is a terrible name for a function.

an easier way to see what's going on, lets define function
abc in class GUID as
int GUID::abc(int a, int b) {...}
Here, abc is a fuinction that takes two integer arguments
and returns an int.

using this pattern, the above definition for "function" defines
a function named "function" that takes two integer arguments
and returns an instance of class GUID_address.
--
Fred K

K' Dash

unread,
Nov 5, 2014, 1:42:07 PM11/5/14
to
Fred K;

Thanx. you are a good teacher. :)
0 new messages