Unary operators

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2004
Posts: 8
Reputation: .·)Tusky(·. is an unknown quantity at this point 
Solved Threads: 0
.·)Tusky(·.'s Avatar
.·)Tusky(·. .·)Tusky(·. is offline Offline
Newbie Poster

Unary operators

 
0
  #1
Jul 25th, 2004
Hello Random People,

I'm new to C++, and I have some questions for all you'all. The first subject I'd like to talk about is Unary Operators. They give me a sample problem in the book. (The book is was published about 2 years ago)

Sample Problem:

int Result, A, B;

A = 4;
B = 23;
Result = 9 + (A++ - --B) * B

Result = ?

The answser -471.

I don't understand how you get that number. Can someone please explane to me how it works. :p
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 95
Reputation: omol is an unknown quantity at this point 
Solved Threads: 4
omol's Avatar
omol omol is offline Offline
Junior Poster in Training

Re: Unary operators

 
0
  #2
Jul 25th, 2004
ahh your working on B-- decriment (-1)
it is before the b
--B

let you work out the rest
asm
{ "\x04f\x06d\x06f\x06c" }
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 8
Reputation: .·)Tusky(·. is an unknown quantity at this point 
Solved Threads: 0
.·)Tusky(·.'s Avatar
.·)Tusky(·. .·)Tusky(·. is offline Offline
Newbie Poster

Re: Unary operators

 
0
  #3
Jul 25th, 2004
What you just said....just ....(?) I HAVE NO IDEA WHAT YOU'RE TALKING ABOUT!!!

But, check this out
VVVVV VVVVV VVVV VVVVVVVVVVV VV V VVV VVVVVVVVV VV

"But I'm not a slave to a god that doesn't exist
But I'm not a slave to world that doesn't give a S•••" - Marilyn Manson (The Fight Song)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC