Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > P((int));

Reply
Thread Tools

P((int));

 
 
Sean M. Tucker
Guest
Posts: n/a
 
      07-24-2004
Hi,
I've seen this in some code, "char* blah P((int))" or "Void* stuff
P((double))"

What does this mean? I've been looking all around and can't find an answer.
Search engions are no help 'cuz they ignore, "((" and "))".

Thanks.

-0x53 0x20 0x65 0x20 0x61 0x20 0x6E


 
Reply With Quote
 
 
 
 
Mike Wahler
Guest
Posts: n/a
 
      07-24-2004
"Sean M. Tucker" <> wrote in message
news:k1jMc.2591$ ...
> Hi,
> I've seen this in some code, "char* blah P((int))" or "Void* stuff
> P((double))"
>
> What does this mean?


I'll assume that where you wrote 'blah', and 'stuff',
the actual code has something else. Why not post *exactly*
what you saw? And what it means could easily depend
upon context.


>I've been looking all around and can't find an
> answer.


I'm not surprised. Your question is very vague.

-Mike


 
Reply With Quote
 
 
 
 
Rob Williscroft
Guest
Posts: n/a
 
      07-24-2004
Sean M. Tucker wrote in
news:k1jMc.2591$ in comp.lang.c++:

> Hi,
> I've seen this in some code, "char* blah P((int))" or "Void* stuff
> P((double))"
>
> What does this mean? I've been looking all around and can't find an
> answer. Search engions are no help 'cuz they ignore, "((" and "))".
>



P( X ) is a macro (#define) that either expands to X (ANSI/ISO mode) or
to () (K & R mode), it allows code to be compiled with a pre-standard
C (not C++ (*)) compiler or with a Standard C or C++ compiler.

*) C++ has never allowed prototypes without the paramiter list.

eg:

char *blah P((int));

With a pre-standard C compiler this will be expanded too:

char *blah ();

With a modern Standard conforming compiler this will be:

char *blah( int );

Whenever you see UPERCASENAME(( something )) there is a fair chance
that some kind of macro trickery is going on.

The double parens' are needed so that (possibly empty) comma
seperated list's can be passed to the macro.

void f P((int, char)); /* void f( int, char ); */

Rob.
--
http://www.victim-prime.dsl.pipex.com/
 
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




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