Solved

Use ellipsis in macro definition VC6

Posted on 2006-11-30
1
800 Views
Last Modified: 2012-08-13
Hi,

i am using Visual C/C++ 6.0 and would like to define a macro which make use of ellipsis.

like this: #define MY_MACRO(...) printf(...)

it works in linux, but seems like the VC compiler dont like it.

Does someone has an idea for this?
0
Comment
Question by:woigl
1 Comment
 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 total points
ID: 18043657
Hi woigl,

Variadic macros were added to C standard in ISO 1999 .. Prior to that they were supported as compiler specific extensions to C.
gcc had supported variadic macros for long ... quite some time before ISO99. However, at that time, VC++ did not have support for variadic macros ...

Newer version do support variadic macros ... I just tried compling an example with VS2005 and it compiled fine.

Cheers!
sunnycoder
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question