Top "C-preprocessor" questions

A textual macro processor applied before compiling C and C++ language programs.

Concatenate int to string using C Preprocessor

I'm trying to figure out how I can concatenate a #define'd int to a #define'd string using the C Preprocessor. …

c c-preprocessor stringification
How do I setup visual studio to register some #defines globally?

What I mean is, in each of my source files I have to insert #define NOGDI to stop windows.h …

c++ visual-studio visual-studio-2005 c-preprocessor
Can boolean operators be used with the preprocessor?

I wondering if it possible to have a preprocessor OR or AND statement? I have this code where I want …

c++ c-preprocessor
Why are preprocessor macros evil and what are the alternatives?

I have always asked this but I have never received a really good answer; I think that almost any programmer …

c++ c++11 c-preprocessor
Objective-C: Forward Class Declaration

I'm writing a multiview app that utilizes a class called RootViewController to switch between views. In my MyAppDelegate header, I …

objective-c c-preprocessor forward-declaration
Can we have recursive macros?

I want to know if we can have recursive macros in C/C++? If yes, please provide a sample example. …

c++ c macros c-preprocessor
Is there a preprocessor directive for detecting C++11x support?

If have some code where I would like to use C++11x extensions as much as possible, but have a …

c++ gcc c-preprocessor preprocessor-directive
How to undefine a define at commandline using gcc

How do I at compile time undefine a compiler macro using gcc. I tried some compile args to gcc like …

gcc macros c-preprocessor
Is there a way to both check a macro is defined and it equals a certain value at the same time

I regularly use object-like preprocessor macros as boolean flags in C code to turn on and off sections of code. …

c macros c-preprocessor directive
Pragma in define macro

Is there some way to embed pragma statement in macro with other statements? I am trying to achieve something like: #…

c-preprocessor pragma stringification