Thread: Female Oriented C++ -- :D

  1. #31
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Yeah, alpha, header files are the most necessary uses for #define. Your welcome for the explanation.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  2. #32
    Registered User
    Join Date
    Dec 2002
    Posts
    119
    I want to know why? thanks.



    alpha, here are the reasons for using const instead of #define:



    they obey the language's scoping rules
    you can see them in the debugger
    you can take their address if you need to
    you can pass them by const-reference if you need to
    they don't create new "keywords" in your program.
    You forgot about the bad, nasty macros that should be replaced with inline functions...
    If you speak or are learning Spanish, check out this Spanish and English Dictionary, it is a handy online resource.
    What happens is not as important as how you react to what happens. -Thaddeus Golas

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. object oriented C
    By FlatLost in forum C Programming
    Replies: 4
    Last Post: 11-08-2005, 06:22 AM
  2. [Code] Oriented Graph
    By ilmarculin in forum C Programming
    Replies: 0
    Last Post: 04-08-2005, 02:09 AM
  3. Party of the first female president
    By vNvNation in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 06-22-2004, 09:46 PM