public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* how to implement this ?
@ 2013-01-07 14:31 horseriver
  2013-01-07 14:53 ` Andrew Haley
  0 siblings, 1 reply; 11+ messages in thread
From: horseriver @ 2013-01-07 14:31 UTC (permalink / raw)
  To: gcc-help

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!

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re:how to implement this ?
@ 2013-01-07 15:30 ugiwgh
  2013-01-07 15:39 ` how " horseriver
  0 siblings, 1 reply; 11+ messages in thread
From: ugiwgh @ 2013-01-07 15:30 UTC (permalink / raw)
  To: horseriver; +Cc: gcc-help

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@gmail.com>;
Date:  Mon, Jan 7, 2013 12:46 PM
To:  "gcc-help"<gcc-help@gcc.gnu.org>; 

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!

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-01-07 15:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-07 14:31 how to implement this ? horseriver
2013-01-07 14:53 ` Andrew Haley
2013-01-07 15:09   ` horseriver
2013-01-07 15:21     ` Andrew Haley
2013-01-07 15:25       ` horseriver
2013-01-07 15:35         ` Andrew Haley
2013-01-07 15:44           ` horseriver
2013-01-07 15:49             ` Andrew Haley
2013-01-07 15:52               ` horseriver
2013-01-07 17:05                 ` Andrew Haley
2013-01-07 15:30 ugiwgh
2013-01-07 15:39 ` how " horseriver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).