Search code examples
preprocessorcompatibilityc-preprocessor

Which of the C-family languages have a preprocessor?


Among the C-syntax family of languages (C, C++, Java, C#, ObjC, JS, AS, ...), which have a preprocessor compatible (to whatever extent) with the C preprocessor?


Solution

  • Objective C is a superset of the C language and was initially implemented as an additional preprocessor to C code. It is fully compatible with C preprocessor.

    None of the others you name have preprocessors compatible with the C spec. Keep in mind that preprocessors are an assembler/compiler-specific thing in many cases, and the functionality you are looking for may or may not be found in different, proprietary IDEs/Compilers.

    Of course, C++ is 100% (more or less) compatible as well.