Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > What following statement means?

Reply
Thread Tools

What following statement means?

 
 
wenmang@yahoo.com
Guest
Posts: n/a
 
      04-26-2005
//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

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      04-26-2005
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
 
Reply With Quote
 
 
 
 
Richard Herring
Guest
Posts: n/a
 
      04-26-2005
In message < .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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/822319ev1'. 'HTTP/1.1 500 Internal Server Error'. chanmm ASP .Net 2 09-07-2010 07:37 AM
better syntax for following simple statement... Stimp ASP .Net 3 11-10-2006 04:20 PM
how the following printf statement works aditya C Programming 9 10-29-2004 10:19 PM
usage of # in the following statement ooze C Programming 3 06-30-2004 05:43 AM
RE: The Web server reported the following error when attempting to create or open the Web project located at the following URL: <URL> =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?= ASP .Net 0 06-07-2004 07:36 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57