Thread: #definitions

  1. #1
    Registered User errigour's Avatar
    Join Date
    Mar 2009
    Posts
    102

    #definitions

    if something says
    Code:
    #define WEAR_LIGHT 0
    then WEAR_LIGHT equals zaro and i could use zero to advocate WEAR_LIGHT am i correct or does the preprocessor do more then just make WEAR_LIGHT equal 0?

  2. #2
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 05-24-2009, 02:42 AM
  2. need help with FIFO QueueItem member definitions
    By jackfraust in forum C++ Programming
    Replies: 15
    Last Post: 02-26-2009, 06:48 PM
  3. Replies: 7
    Last Post: 11-17-2008, 01:00 PM
  4. Memory Leak
    By jtullo in forum C Programming
    Replies: 7
    Last Post: 12-11-2006, 11:45 PM
  5. help writing function definitions
    By jlmac2001 in forum C++ Programming
    Replies: 2
    Last Post: 04-10-2003, 09:44 PM