CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2002
    Posts
    28

    # define MSG "bla.." where bla... is on 2 lines?

    Hi,

    Does anyone know how to do that or if it can be done? I want MSG to be a long paragraph.

    # define MSG "bla bla bla bla
    bla bla bla....."


    Thank you!

  2. #2
    Join Date
    Jun 2002
    Location
    Letchworth, UK
    Posts
    1,020
    Add a backslash for continuation. If it is a string, you can split the string over several lines
    Code:
    // lame example
    #define tangent(x)  \
        sin(x) / \
        cos(x)
    
    // Remember to put a space after the "
    #define PANGRAM \
        "Xylophone wizard " \
        "begets " \
        "quick jive form"
    Succinct is verbose for terse

  3. #3
    Join Date
    Sep 2002
    Posts
    28
    Thank you! It works great

    Cat
    Visual Basic 6 Learning Edition

  4. #4
    Join Date
    Mar 2002
    Location
    California
    Posts
    1,582
    Code:
    const char* MSG = "Prefer using global constants to macro defines.";
    Jeff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured