| | |
C++ For Loop User Response
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jul 2006
Posts: 7
Reputation:
Solved Threads: 0
Hi all.
I can't get this to compile;
when i try to compile this message comes up:
What does this mean? What can i do to get it to work?
Any help would be greately appreciated.
I can't get this to compile;
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <string> using namespace std; int main () { int number; string response; for (number=5; response!='Y';) { cout <<number <<endl; cout <<"Had Enough (Y/N)?"; cin>>response; } cin.get (); cin.get (); return 0; }
when i try to compile this message comes up:
C++ Syntax (Toggle Plain Text)
no match for 'operator!=' in 'response!='Y''
What does this mean? What can i do to get it to work?
Any help would be greately appreciated.
Or
response !="Y"
response !="Y"
•
•
Join Date: Jul 2006
Posts: 7
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by Grunt
Or
response !="Y"
C++ Syntax (Toggle Plain Text)
expected primary-expression before "char"
•
•
Join Date: Jul 2006
Posts: 7
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by portege
char response;
for (number=5; response!='Y' and response != 'y'
response !='y' seemed to be redunant.Now i'm playing around to figure out how to make it repeat the question if you just type return - though i have a fealing it is far to complex for me right now!
Last edited by Simon268; Jul 20th, 2006 at 11:51 am.
![]() |
Similar Threads
- do-while loop & other stuff (Java)
- Halp in breaking a loop (C++)
Other Threads in the C++ Forum
- Previous Thread: Please help a beginner - window closes
- Next Thread: Interface objects
| Thread Tools | Search this Thread |
api array arrays based binary c++ c/c++ calculator char char* class classes code coding compile console conversion convert count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






