Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters
Register

Reply
 
LinkBack Thread Tools
Old 02.10.2001, 02:45   #1
Младенец
 
Join Date: 10 2001
Location: Louisville
Posts: 1
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post multiplication

I know this is a really easy problem, but it's driving me up the wall. I"m writing a program that at a point I have to multiply something in an arry by -1 to mark that I have already been to that point, then when I finish what I am supposed to do I multiply by -1 again to change the array back to normal.

Anyways, my question is this. When I multiply by -1 which the code is squares[start] * -1, it give me the following error

'*': operator has no effect; expected operator with side-effect
Reply With Quote
Old 02.10.2001, 04:04   #2
Moderator
 
acid's Avatar
 
Join Date: 09 2001
Location: South Korea, Gumi
Posts: 7,699
Downloads: 102
Uploads: 34
Blog Entries: 16
Reputation: 561 | 6
Exclamation

Paste code part, which gives you that error, that would help us to give you more specific answer.

acid
Reply With Quote
Old 02.10.2001, 05:06   #3
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Downloads: 0
Uploads: 0
Reputation: 18 | 5
Post

I think you just have to use braces:

squares[start] * (-1)

<BR> <IMG SRC="smile.gif" border="0"> goood luck.
Reply With Quote
Sponsored Links
Reply

« - | ++/-- operators »
Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 21:48.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.