AKB Forums

Go Back   AKB Forums > Technical sections > Languages, Compilers and Interpreters
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Languages, Compilers and Interpreters C,C++,C#,.NET,Java,PHP,Perl,SQL and more

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old Oct 2, 2001, 01:45   #1
Младенец
 
Join Date: Oct 2001
Location: Louisville
Posts: 1
Rep Power: 0
Reputation: 10
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
Kevin is offline   Reply With Quote Quote selected
Old Oct 2, 2001, 03:04   #2
Administrator
 
acid's Avatar
 
Join Date: Sep 2001
Location: South Korea, Gumi
Posts: 7,189
Blog Entries: 15
Rep Power: 10
Reputation: 313
Exclamation

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

acid
__________________
Chat with acid


acid is offline   Reply With Quote Quote selected
Old Oct 2, 2001, 04:06   #3
Administrator
 
greka's Avatar
 
Join Date: Sep 2001
Location: @work
Posts: 5,347
Rep Power: 10
Reputation: 23
Send a message via ICQ to greka
Post

I think you just have to use braces:

squares[start] * (-1)

<BR> <IMG SRC="smile.gif" border="0"> goood luck.
__________________
И повешенные могут качаться в неположенную сторону. /С.Е.Лец/
greka is offline   Reply With Quote Quote selected
Reply

« - | ++/-- operators »

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:53.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link