By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,816 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,816 IT Pros & Developers. It's quick & easy.

What following statement means?

P: n/a
//a header file

#define API_ABC

//a CPP file

class API_ABC Myclass;
class Myclass{
......
};

What does "#define API_ABC" do when declaring a class(Myclass in this
case)? Why use it?

Thanks.

WM

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
we*****@yahoo.com wrote:
//a header file

#define API_ABC

//a CPP file

class API_ABC Myclass;
class Myclass{
.....
};

What does "#define API_ABC" do when declaring a class(Myclass in this
case)? Why use it?


Why don't you ask the one who wrote it?

In some systems you're allowed to give additional qualifiers to any
symbol or class, like __declspec(dllexport) or some such nonsense.
Perhaps in some other incarnation of this code 'API_ABC' is actually
defined to expand into some kind of linkage specification...

V
Jul 23 '05 #2

P: n/a
In message <11**********************@z14g2000cwz.googlegroups .com>,
we*****@yahoo.com writes
//a header file

#define API_ABC

//a CPP file

class API_ABC Myclass;
class Myclass{
.....
};

What does "#define API_ABC" do when declaring a class(Myclass in this
case)?
Nothing, in this case.
Why use it?


(a) Maybe as a hint to the maintainer that the class is an abstract base
class needed for this application programming interface .

(b) In some programming environments the macro might be differently
defined, so it expands to some (non-standard) compiler- and
platform-dependent string which tells the compiler to do something
special with the class.

--
Richard Herring
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.