954,136 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Unary operators

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

.·)Tusky(·.
Newbie Poster
8 posts since Jul 2004
Reputation Points: 10
Solved Threads: 0
 

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

let you work out the rest :)

omol
Junior Poster
156 posts since Jul 2004
Reputation Points: 10
Solved Threads: 10
 

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

.·)Tusky(·.
Newbie Poster
8 posts since Jul 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You