Solved

Use ellipsis in macro definition VC6

Posted on 2006-11-30
1
814 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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 viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

707 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