Top "C-preprocessor" questions

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

#define in Java

I'm beginning to program in Java and I'm wondering if the equivalent to the C++ #define exists. A quick search …

java preprocessor c-preprocessor
The role of #ifdef and #ifndef

#define one 0 #ifdef one printf("one is defined "); #ifndef one printf("one is not defined "); In this what is the …

c-preprocessor
Including one C source file in another?

Is it OK (or even recommended/good practice) to #include a .c file in another .c file?

c include c-preprocessor code-organization project-organization
How to detect reliably Mac OS X, iOS, Linux, Windows in C preprocessor?

If there's some cross-platform C/C++ code that should be compiled on Mac OS X, iOS, Linux, Windows, how can …

c++ c cross-platform c-preprocessor os-detection
How do I check OS with a preprocessor directive?

I need my code to do different things based on the operating system on which it gets compiled. I'm looking …

c operating-system c-preprocessor conditional-compilation
GCC dump preprocessor defines

Is there a way for gcc/g++ to dump its preprocessor defines from the command line? I mean things like __…

gcc g++ c-preprocessor
C# Macro definitions in Preprocessor

Is C# able to define macros as is done in the C programming language with pre-processor statements? I would like …

c# macros c-preprocessor
Error: invalid operands of types ‘const char [35]’ and ‘const char [2]’ to binary ‘operator+’

At the top of my file I have #define AGE "42" Later in the file I use ID multiple times including …

c++ string c-preprocessor stdstring
Why does the C preprocessor interpret the word "linux" as the constant "1"?

Why does the C preprocessor in GCC interpret the word linux (small letters) as the constant 1? test.c: #include <…

c linux gcc c-preprocessor
C++ preprocessor __VA_ARGS__ number of arguments

Simple question for which I could not find answer on the net. In variadic argument macros, how to find the …

c++ c c-preprocessor variadic-macros