| | |
practice(newbie)
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: May 2004
Posts: 11
Reputation:
Solved Threads: 0
Hello guys,
This code returns 2 errors and I dont understand why.
Any idea? thanks
This code returns 2 errors and I dont understand why.
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <string> using namespace std; char choice; void M(); void C(); void Process(); void M(){ cout <<"Multiplication\n"; } void C(){ cout << "Calculation\n"; } void Process(){ cout << "Make a choice\n" << "C or M only\n"; cin >> choice; while (strcmp(choice, "M")!=0) || (strcmp(choice, "C")!=0){ cout << "ERROR Enter again"; cin >> choice; } return; } void main () { Process(); while (strcmp(choice, "M") == 0){ M(); } return; while (strcmp(choice, "C") == 0){ C(); return ; } }
Any idea? thanks
MSVC++
•
•
•
•
Originally Posted by abu_sager
Hello my poor c++ programmers
strcmp take two argument of type char * i.e array of character not char
i.e you can compare between
char *p = "SADDAM",l= "BOOSH";
cout << strcmp(p,l);
i hope you understand this thing
:!:
![]() |
Similar Threads
- As a newbie, where i should start from in linux? (Getting Started and Choosing a Distro)
- How to network two Win98 machines (Networking Hardware Configuration)
- No Posts? (DaniWeb Community Feedback)
- please help me i am a programming newbie (Visual Basic 4 / 5 / 6)
Other Threads in the C++ Forum
- Previous Thread: Parse error, syntax error, Forbids declaration
- Next Thread: switch/case statement
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





