About 19,100,000 results
Open links in new tab
  1. Is it possible to use a if statement inside #define?

    As far as I know, what you're trying to do (use if statement and then return a value from a macro) isn't possible in ISO C... but it is somewhat possible with statement expressions (GNU extension). Since …

  2. c++ - Why use #define instead of a variable - Stack Overflow

    May 14, 2011 · What is the point of #define in C++? I've only seen examples where it's used in place of a "magic number" but I don't see the point in just giving that value to a variable instead.

  3. What is the difference between #define and const? [duplicate]

    The #define directive is a preprocessor directive; the preprocessor replaces those macros by their body before the compiler even sees it. Think of it as an automatic search and replace of your source code. …

  4. c# - How do you use #define? - Stack Overflow

    Oct 30, 2013 · 8 #define is used to define compile-time constants that you can use with #if to include or exclude bits of code.

  5. Define a preprocessor macro through CMake - Stack Overflow

    Jan 24, 2024 · How do I define a preprocessor variable through CMake? The equivalent code would be #define foo.

  6. How can I use #if inside #define in the C preprocessor?

    How can I use #if inside #define in the C preprocessor? Asked 15 years, 7 months ago Modified 8 months ago Viewed 51k times

  7. How to define constants in Visual C# like #define in C?

    In C you can define constants like this #define NUMBER 9 so that wherever NUMBER appears in the program it is replaced with 9. But Visual C# doesn't do this. How is it done?

  8. c++ - 'static const' vs. '#define' - Stack Overflow

    Oct 28, 2009 · Is it better to use static const variables than #define preprocessor? Or does it maybe depend on the context? What are advantages/disadvantages for each method?

  9. Is there a way to do a #define inside of another #define?

    Is there a way to do a #define inside of another #define? Asked 15 years, 4 months ago Modified 6 years, 11 months ago Viewed 59k times

  10. c - #Define VS Variable - Stack Overflow

    Jun 18, 2012 · #define WIDTH 10 is a preprocessor directive that allows you to specify a name (WIDTH) and its replacement text (10). The preprocessor parses the source file and each occurrence of the …