Re: [Dev-C++] problem with "while" loop
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: <Mat...@bm...> - 2009-03-27 11:39:23
|
Have another look at this line : while (again='y') Think about comparison as opposed to assignment. From: Chedtha Intaravitak [mailto:che...@gm...] Sent: 27 March 2009 10:45 To: dev...@li... Subject: [Dev-C++] problem with "while" loop Hi I had a problem running an attached C++ source code. It's a very simple program demonstrating how to use a while loop. The program compiled and run o.k. But it didn't seem to change the value of a variable "again" (from user input "cin" command) so the program keep repeating the while loop. The initialized value of the variable is 'y' but then when I input 'n' to change its value, the program didn't seem to change its value to 'n'. What am I missing? thanks Chedtha This email was sent from an email account of BMW (UK) Manufacturing Limited. BMW (UK) Manufacturing Limited is a company registered in England and Wales with company number 3950868; and has its offices at Ellesfield Avenue, Bracknell, Berkshire, RG12 8TA; registered in England and Wales. The contents of this e-mail are confidential and may be privileged and subject to internal monitoring. If you are not the addressee indicated in this message, you may not copy, forward, disclose, deliver or otherwise use it or any part of it in any form whatsoever. You should then kindly notify the sender by replying to this message and destroy it thereafter. Opinions, conclusions and other information in this message that do not relate to the official business of any BMW Group Company shall be understood as neither given nor endorsed by them. |