shorter form for value=~value; ?

hi,
is there a shorter form for value=~value; or value^=0xff; like i++; ?
rosche777Asked:
Who is Participating?
 
joe_hConnect With a Mentor Commented:
how about:

#define NOT(a) ((a)=~(a))
...
NOT(value)
...


however, be careful about the legibility of your code, since the value of the parameter is modified.

Joe_h
0
 
captainkirkCommented:
don't believe so...
0
 
ua1zclCommented:
Seems no, because you wish to modify a value.
In some function it looks shorter:
int func(int value);

func(~value);

But value stay unchanged.

0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
rosche777Author Commented:
hmm.. the value must change..
a syntax like value~~; doesn't exist? :(
0
 
captainkirkCommented:
Only the increment and decrement operators have syntax like that - the only choices I know of are macros, function calls, and the form you posted - value ~= value.
0
 
joe_hCommented:
Nope.
0
 
rosche777Author Commented:
oke thx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.