[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

shorter form for value=~value; ?

hi,
is there a shorter form for value=~value; or value^=0xff; like i++; ?
0
rosche777
Asked:
rosche777
  • 2
  • 2
  • 2
  • +1
1 Solution
 
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
 
joe_hCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now