NeedASurgery
Member
- Joined
- Oct 24, 2009
- Messages
- 62
- Reaction score
- 0
- Points
- 6
So, I'm struggling with a programming assignment. There's NO WAY I'm going to get this finished and working ... but I'd like as much credit for it as possible. The program must run until the user inputs "EXIT". So I have the whole program dependent on this while loop:
while (istring != 'EXIT') //istring being the input string
I've tried "EXIT" and 'EXIT'. The program NEVER STOPS LOOPING. :-D
It might have something to do with the way I'm inputing the string?
cout << "Begin logic."<<endl;
cout << "logic: ";
cin.getline (istring, 40, '\n');
Thoughts? Help? Bullet right in my temple?
I'm using Visual C++ 2008 Express if that helps.
BTW, when did they do away with iostream.h and whats with this using namespace crap?! As if this class wasn't going to be difficult enough for me (I haven't taken a coding class in over ten years).
Thanks!
Thank you Link!
Sorry. istring is a character array.
char istring[40];
while (istring != 'EXIT') //istring being the input string
I've tried "EXIT" and 'EXIT'. The program NEVER STOPS LOOPING. :-D
It might have something to do with the way I'm inputing the string?
cout << "Begin logic."<<endl;
cout << "logic: ";
cin.getline (istring, 40, '\n');
Thoughts? Help? Bullet right in my temple?
I'm using Visual C++ 2008 Express if that helps.
BTW, when did they do away with iostream.h and whats with this using namespace crap?! As if this class wasn't going to be difficult enough for me (I haven't taken a coding class in over ten years).
Thanks!
Thank you Link!
Sorry. istring is a character array.
char istring[40];