1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

macro

Discussion in 'C' started by anilk501, Sep 13, 2007.

  1. anilk501

    anilk501 New Member

    Joined:
    Oct 3, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    0
    1) write generic swap macro used to swap data b/w any type: swap 2 int ,float or char etc.
     
  2. listendinesh

    listendinesh New Member

    Joined:
    Aug 3, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    You can do it without temp var.
    Code:
    #define SWAP(a,b)  a=a+b;b=a-b;a=a-b;
     

Share This Page