Macro question

This is a discussion on Macro question within the C Programming forums, part of the General Programming Boards category; Code: #define paste(front, back) front ## back Can someone tell me how to use this macro? Thanks....

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    204

    Macro question

    Code:
    #define paste(front, back)   front ## back
    Can someone tell me how to use this macro? Thanks.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,541
    Code:
    int paste(foo,bar) = 0;
    Would appear to the compiler as
    Code:
    int foobar = 0;
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 12:14 PM
  3. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 08:22 PM
  4. design question: opinion
    By ggs in forum C Programming
    Replies: 2
    Last Post: 01-29-2003, 10:59 AM
  5. macro (#define) question
    By Darrok in forum C++ Programming
    Replies: 30
    Last Post: 12-20-2001, 04:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21