need help

T

toto

i have this class:

class Process : public Gob
{
private:
TotalAmount *Process::getTotalAmount( DetailList & dl );

public:
virtual void operator()(Invoice&);
};

what does the :: sign mean here ?

thanks !
 
R

Rolf Magnus

toto said:
i have this class:

class Process : public Gob
{
private:
TotalAmount *Process::getTotalAmount( DetailList & dl );

public:
virtual void operator()(Invoice&);
};

what does the :: sign mean here ?

It means a syntax error.
 
J

Jonathan Turkanis

toto said:
i have this class:

class Process : public Gob
{
private:
TotalAmount *Process::getTotalAmount( DetailList & dl );

public:
virtual void operator()(Invoice&);
};

Maybe you mean

private:
TotalAmount * getTotalAmount( DetailList & dl );

(a member function declaration) or

private:
TotalAmount (Process::*getTotalAmount)( DetailList & dl );

( pointer to member decalration).

Your syntax is half-way between the two. It is an error.

Jonathan
 
S

Sharad Kala

toto said:
i have this class:

class Process : public Gob
{
private:
TotalAmount *Process::getTotalAmount( DetailList & dl );

Don't you get a compilation error here that qualified name is not allowed in a
member declaration?
public:
virtual void operator()(Invoice&);
};

what does the :: sign mean here ?

It is the scope resolution operator.
TotalAmount *Process::getTotalAmount( DetailList & dl )
{
....
}
This would mean that Process class has a member function called getTotalAmount.
This is the definition of the member function.

-Sharad
 
T

toto

so this would be equivalent to :

class Process : public Gob
{
private:
TotalAmount *getTotalAmount( DetailList & dl );

public:
virtual void operator()(Invoice&);
};


right ?
 
S

Sharad Kala

toto said:
so this would be equivalent to :

class Process : public Gob
{
private:
TotalAmount *getTotalAmount( DetailList & dl );

public:
virtual void operator()(Invoice&);
};


right ?

Please don't top-post.
Yes, this is syntactically correct.
Note that you have just declared and not defined the member functions yet.
You could define them within the class body (inline)-
TotalAmount *getTotalAmount( DetailList & dl )
{
....
}
or
Outside the class body
TotalAmount *Process::getTotalAmount( DetailList & dl )
{
....
}

-Sharad
 
T

toto

ok, thanks.
what is TOP-POST ?
Sharad Kala said:
Please don't top-post.
Yes, this is syntactically correct.
Note that you have just declared and not defined the member functions yet.
You could define them within the class body (inline)-
TotalAmount *getTotalAmount( DetailList & dl )
{
...
}
or
Outside the class body
TotalAmount *Process::getTotalAmount( DetailList & dl )
{
...
}

-Sharad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,901
Members
47,439
Latest member
elif2sghost

Latest Threads

Top