| | |
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
Views: 2977 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll download dynamic encryption error file forms fstream function functions game givemetehcodez google graph gui iamthwee ifstream input int integer java lib library linkedlist linker linux loop looping loops map math matrix memory microsoft newbie news number output parameter pointer problem program programming project python random read recursion recursive reference return sort stream string strings struct studio system template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets





