About 11,100,000 results
Open links in new tab
  1. Difference between `constexpr` and `#define` - Stack Overflow

    Feb 12, 2021 · So I read the interesting answers about what are the differences between constexpr and const but I was curious about are the differences between #define and …

  2. What is the scope of a #define? - Stack Overflow

    Jul 6, 2016 · What is the scope of a #define? I have a question regarding the scope of a #define for C/C++ and am trying to bet understand the preprocessor. Let's say I have a project …

  3. What is define([ , function ]) in JavaScript? - Stack Overflow

    What is define ( [ , function ]) in JavaScript? [duplicate] Asked 12 years, 5 months ago Modified 2 years, 10 months ago Viewed 240k times

  4. 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.

  5. Why are #ifndef and #define used in C++ header files?

    I have been seeing code like this usually in the start of header files: #ifndef HEADERFILE_H #define HEADERFILE_H And at the end of the file is #endif What is the purpose of this?

  6. What's the difference in practice between inline and #define?

    Aug 24, 2010 · Macros (created with #define) are always replaced as written, and can have double-evaluation problems. inline on the other hand, is purely advisory - the compiler is free …

  7. 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.

  8. Array format for #define (C preprocessor) - Stack Overflow

    Probably a naïve question - I used to program 20 years ago and haven't coded much since. My memory of how the C preprocessor works has atrophied significantly since then... I am writing …

  9. c - How do I concatenate #define value? - Stack Overflow

    Mar 11, 2014 · You can generally use the ## (double number sign) to concatenates two tokens in a macro invocation. However, since you have string literals jamming an already defined …

  10. c++ - Declaring a function using #define - Stack Overflow

    Jul 9, 2018 · The #define version is still a macro. The code is expanded at the invocation site. It has all the expected problems (with macros) including namespace pollution and unexpected …