type

M

Michael Sgier

Hi
why Tag is declared twice?

// Public functions
...
Tag GetKeyId (void);
...

protected:
Tag keyId;


thx.
michael
 
F

Frederick Gotham

Michael Sgier posted:
Hi
why Tag is declared twice?

// Public functions
...
Tag GetKeyId (void);
...

protected:
Tag keyId;



class Arb {
public:

typedef int Tag; /* This defines a type */

Tag GetKeyId(void); /* This declares a function */

protected:

Tag keyId; /* This defines an object */

};
 
R

Ron Natalie

Frederick said:
class Arb {
public:

typedef int Tag; /* This defines a type */
No, it defines a synonym for the int type. Typedef's do not
define new types, just new names for existing ones.

void over(Tag);
and void over(int);

are identical function types...they're not overloads.
 

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,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top