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 answerme, Feb 23, 2008.

  1. answerme

    answerme New Member

    Joined:
    Dec 17, 2007
    Messages:
    114
    Likes Received:
    0
    Trophy Points:
    0
    #define KS(p) ks((void *)&p)

    Can anyone explain me what this macro is doing
     
  2. technosavvy

    technosavvy New Member

    Joined:
    Jan 2, 2008
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    0
    i hope u will understand with this example:
    ASSUMING: ks (in lower case) is an in built function

    Code:
    int p = 5;
    Now, KS(p) will call the function ks passing the address of variable p and typescasting it to a void *.
     
  3. answerme

    answerme New Member

    Joined:
    Dec 17, 2007
    Messages:
    114
    Likes Received:
    0
    Trophy Points:
    0
    Thanks
    I know why do we use void pointer ,but in real time project what is the use of it .
     

Share This Page