GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #11  
Old 28-Oct-2009, 09:44
anonymous91 anonymous91 is offline
New Member
 
Join Date: Oct 2009
Posts: 7
anonymous91 is on a distinguished road

Re: Loop just doesn't want to stop looping when I tell it to...


Quote:
Originally Posted by jnCPP
I'm wondering why you're using a string for one character?
Also, you might run into errors because your (posted) code doesn't prepare for the possibility of a 'Y' or 'N'.
I suggest using toupper (if you're allowed to)
or alternatively using the ||


its a simplified version of what im doing.
i wasn't going to put that because it was unnecessary but since you asked.


the whole thing actually allows for
CPP / C++ / C Code:
if (stringb == "N" || stringb == "n" || stringb == "No" || stringb == "NO" || stringb == "no")

if (stringb == "y" || stringb == "Y" || stringb == "yes" || stringb == "YES" || stringb == "Yes")

and that should answer the string question as well i believe.

it also has to be able to retain a sentence say someone wanted to enter a sentence. regardless if it's going to be used it or not.


Quote:
Originally Posted by Howard_L
Your problem is caused by a mistake in the condition test in this statement:
CPP / C++ / C Code:
for (;a=5;)

thanks, that helped, thats actually the site im learning from.
i was on that page, and i had tried 'while loops' before but it didnt work, but now i know that's because i was setting 'a' = 5, instead of 'a'==5

so the problem's solved, thanks everyone that helped.
 
 

Recent GIDBlogProgramming ebook direct download available by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classic recursion game of 8 Queens errors BKizzle77 Java Forum 11 11-Aug-2008 01:35
breaking an infinite loop through stdin pisuke C Programming Language 9 03-Jul-2007 21:19
Text-Based Roulette Game mfm1983 C++ Forum 5 29-Nov-2006 13:20
coding a sentinel controlled loop tommy69 C++ Forum 2 10-Mar-2004 15:52

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 19:22.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.