Isnt it meant to be like:
While(car = red)
or similar?
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
>I am stuck with the while statement, I am not sure how to state when I want it to stop.
Usually you tell the user to enter a negative number to quit when dealing with numbers (assuming of course, that you don't need negative numbers from the input). So the condition would be something like
while (input >= 0)
The only problem is that you usually ask the user to enter a negative number at the first input statement at the prompt. So then you must ask the user for the dimensions of the box before the program will exit.
You can always break out of the loop if you find that the number is negative, which is probably the easiest for you (for now).
>Isnt it meant to be like: While(car = red)
That would be wrong, because = is an assignment operator. You'd be assigning car to red , which would be rather pointless, and quite likely you'd enter an infinite loop (if red never changed).
John A
Vampirical Lurker
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
It's got something to do with Microsoft wanting t_main with their compiler, although I don't really know much about it.
I'd research it a little bit more, except I want to watch the hockey game. Sorry :P
John A
Vampirical Lurker
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
Thank you for your assistance, I do appreciate it. Although I am still unclear on the while statement, I have now used
While(result !=0). However, I am now receiving the error message
error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup I tried to look up this error message in the MS Help section, but am not receiving as much information as I would have hoped for.
Its not a problem with the code but with your project configuration. The most common reason you get this errror is when you don't create a console project.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734