Top "C-preprocessor" questions

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

How to write a while loop with the C preprocessor?

I am asking this question from an educational/hacking point of view, (I wouldn't really want to code like this). …

c while-loop c-preprocessor
Is the sizeof(enum) == sizeof(int), always?

Is the sizeof(enum) == sizeof(int), always ? Or is it compiler dependent? Is it wrong to say, as compiler are …

c enums constants c-preprocessor
Seeing expanded C macros

If I want to expand a C macro, what are some good ways to do that (besides tracing it manually)? …

c c-preprocessor
What's the difference between the WIN32 and _WIN32 defines in C++

I know that WIN32 denotes win32 compilation but what is _WIN32 used for?

c++ c-preprocessor
stdlib.h: no such file or directory

I am using various stdlib functions like srand(), etc. I have the line #include <stdlib.h> at the …

c gcc include c-preprocessor redhat
How do I generate an error or warning in the C preprocessor?

I have a program that must be compiled only in DEBUG mode. (testing purpose) How can I have the preprocessor …

c-preprocessor
Is it possible to iterate over arguments in variadic macros?

I was wondering if it is possible to iterate over arguments passed to a variadic macro in C99 or using …

c foreach c99 c-preprocessor variadic
Namespaces in C

Is there a way to (ab)use the C preprocessor to emulate namespaces in C? I'm thinking something along these …

c++ c namespaces c-preprocessor
What are the valid characters for macro names?

Are C-style macro names subject to the same naming rules as identifiers? After a compiler upgrade, it is now emitting …

c compiler-warnings c-preprocessor
What's the difference between #if and #ifdef Objective-C preprocessor macro?

How to define preprocessor macros in build settings, like IPAD_BUILD, and IPHONE_BUILD (and how to use them in …

ios objective-c macros c-preprocessor conditional-compilation