Re: [Dev-C++] problem with "while" loop
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Alessandro B. <ale...@is...> - 2009-03-27 11:47:44
|
while (again='y') instead of while (again=='y') You make an assignment instead of a comparison. Alessandro Chedtha Intaravitak ha scritto: > 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 > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > -- ************************************************ Prof. Alessandro Bugatti Docente di Informatica Istituto Tecnico Industriale Statale B. Castelli E-mail: ale...@is... Sito web: www.imparando.net ************************************************ |