Search:
Forum
General C++ Programming
solved
Page 2
solved
Pages:
1
2
Sep 26, 2010 at 5:14pm UTC
ne555
(10692)
L B
wrote:
you can't put -b. You CAN however do 0-b, which is what you want.
Are you sure that doubles don't have the unary operator - ?
Sep 26, 2010 at 5:59pm UTC
LB
(13399)
They do, but it gives me a compiler error if I try to do x = (-b). I guess I'm doing it wrong.
Sep 26, 2010 at 6:25pm UTC
Galik
(2254)
LB
wrote:
They do, but it gives me a compiler error if I try to do x = (-b).
What compiler are you using and what error does it give? That's looks perfectly legal to me.
Sep 26, 2010 at 6:30pm UTC
LB
(13399)
It tells that it expected a 'primary expression' before '-'.
Oct 9, 2010 at 4:05pm UTC
jumper007
(435)
It tells that it expected a
'primary expression'
before
'-'
.
mate, try with
x==-b
ok ?
this is working in all C++ programming languages. trust me.
and oh, dont use () , and do == instead of =. this works for me. i hope i helped
Topic archived. No new replies allowed.
Pages:
1
2
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs