Solved

Use ellipsis in macro definition VC6

Posted on 2006-11-30
1
787 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now