943,378 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 3731
  • C++ RSS
Jul 25th, 2004
0

Unary operators

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
.·)Tusky(·. is offline Offline
8 posts
since Jul 2004
Jul 25th, 2004
0

Re: Unary operators

ahh your working on B-- decriment (-1)
it is before the b
--B

let you work out the rest
Reputation Points: 10
Solved Threads: 10
Junior Poster
omol is offline Offline
156 posts
since Jul 2004
Jul 25th, 2004
0

Re: Unary operators

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
.·)Tusky(·. is offline Offline
8 posts
since Jul 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: fstream and struct question
Next Thread in C++ Forum Timeline: Unary Operators





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC