Thread: Multi line macros -- coding convetion

  1. #1
    Registered User
    Join Date
    Mar 2008
    Location
    India
    Posts
    133

    Multi line macros -- coding convetion

    Hello All,

    I read some where on macros belwo line.

    "All multi-statement macros shall be surrounded by a
    Code:
    do {} while(0)
    loop. Failure to do this may cause problems when the macro is expanded."

    I could not able to get what is failure we can expect when macro gets expanded..?

    Any idea on this ..?


    Thanks
    Rama Kanth

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,730
    Imagine if you used your macro in the body of an if statement and did not use braces to delimit the if statement's body.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do i get a multi line string..??
    By clearn in forum C Programming
    Replies: 2
    Last Post: 11-18-2012, 06:16 AM
  2. Multi line macro help
    By bmancl in forum C Programming
    Replies: 17
    Last Post: 10-26-2009, 09:19 PM
  3. writing a Multi-Line string
    By cornacum in forum C Programming
    Replies: 3
    Last Post: 02-22-2009, 09:53 AM
  4. Multi line
    By Salibea in forum Windows Programming
    Replies: 11
    Last Post: 08-11-2005, 04:00 AM
  5. Multi-Line EditBox in Dialog.
    By Devil Panther in forum Windows Programming
    Replies: 2
    Last Post: 06-06-2003, 04:37 PM