User Profile

Collapse

Profile Sidebar

Collapse
vivekgarg
vivekgarg
Last Activity: Oct 7 '08, 08:31 AM
Joined: Oct 1 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • vivekgarg
    replied to conditional expansion of a macro
    in C
    Yeah Donbock what you said was certainly correct in it's own context but I guess I was not clear enough in my question.
    Basically what I am asking is, why this peice of code dosen't work and what is the possible solution.

    #ifdef ABC
    #define TEST /
    cout<<"abc"
    #else
    #define TEST
    cout<<"xyz"
    #endif

    int main()
    {
    TEST;...
    See more | Go to post

    Leave a comment:


  • vivekgarg
    started a topic conditional expansion of a macro
    in C

    conditional expansion of a macro

    Hi,
    Can I use some conditional operator to select a part of code to be expanded.
    What I meant was... Can I do something like this..

    #define func(arg1) \
    if arg1 == abc\ \* this line should not expand but just test*\
    some code\
    else\ \* this line should not expand but just test*\
    some other code


    Thanks
    See more | Go to post
No activity results to display
Show More
Working...