1

Hello guys,
This code returns 2 errors and I dont understand why.

#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

4
Contributors
5
Replies
7
Views
12 Years
Discussion Span
Last Post by kc0arf
Featured Replies
  • 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 Read More

0

Oh... I got it. I'm using strcmp to compare a char variable. :)

1

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

0

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

What makes you so rich abu_sager?
:!:

0

Abu & FireNet,

Let's keep the discussion Technical, and leave the other stuff off the boards please. That is what we are here for. Let's choose our wording better next time.

Christian

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.