Re:how to implement this ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If I didn't understand wrong, you can do it like this.

#define calc(_a,_b,_c) ((0==(_a))?((_b)==8):((_c)=8))



------------------ Original ------------------
From:  "horseriver"<horserivers@xxxxxxxxx>;
Date:  Mon, Jan 7, 2013 12:46 PM
To:  "gcc-help"<gcc-help@xxxxxxxxxxx>; 

Subject:  how to implement this ?



hi:

  how to implement this assignment by MACRO?
  int a,b,c ;
  
  ((a==0)?b:c)=8;

  if use this sentence ,gcc will tell :error: lvalue required as left operand of assignment

  is there s implementation for this with  macro  define?

  is there suggestion ?

  
  thanks!



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux