About 9,550,000 results
Open links in new tab
  1. 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 …

  2. 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, 6 months ago Modified 8 months ago Viewed 51k times

  3. c preprocessor - Is there a good reason for always enclosing a …

    #define _add_penguin(a) penguin ## a #define add_penguin(a) _add_penguin(a) #define WIDTH (100) #define HEIGHT 200 add_penguin(HEIGHT) // expands to penguin200 …

  4. error Please #define _AFXDLL or do not use /MD [d] occurs even …

    Jul 30, 2014 · Why don't you just do what it says and #define _AFXDLL? C/C++, Preprocessor, Preprocessor Definitions setting.

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

  6. c - #define or enum? - Stack Overflow

    Jun 29, 2010 · Possible Duplicate: Why use enum when #define is just as efficient? When programming in C, is it better practice to use #define statements or enums for states in a state …

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

  8. How do I define a function with optional arguments?

    How do I define a function with optional arguments? Asked 13 years, 8 months ago Modified 1 year, 4 months ago Viewed 1.2m times

  9. Why do most C developers use define instead of const?

    Mar 4, 2017 · #define simply substitutes a name with its value. Furthermore, a #define 'd constant may be used in the preprocessor: you can use it with #ifdef to do conditional compilation …

  10. What is the purpose of the #define directive in C++?

    May 10, 2010 · #define to define numerical constants can be easily replaced by a const "variable", that, as a #define, doesn't really exist in the compiled executable. AFAIK it can be used in …