CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: macro tricks

Threaded View

  1. #1
    Join Date
    Jul 2007
    Location
    london
    Posts
    247

    macro tricks

    i was wondering if it was possible to do this?

    Code:
    #define print_code(line) line cout << quote line quote << endl;
    #define quote "
    
    print_code(true;)
    to be macroed to

    Code:
    true; cout << "true;" << endl;
    how could i do this? just curiouse

    thanks

    UPDATE SOLVED

    Code:
    #define print_code(line) line cout << #line << endl;
    Last edited by g3RC4n; March 11th, 2008 at 07:41 PM.

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