Sorry if the terminology in the title is incorrect but basically I want to compare a char array with a char * array that contains string literals. Basically I have an array:
char temp[6];
cin.get();
cout << "Enter: ";
cin.getline(temp,6);
And:
char *compare[10] = {".- ", "-... ", "-.-. ", "-.. ", ". ", "..-. "};
How do I go about comparing the string entered by the user into "temp" with the "compare" array elements. Example if user enters: " -... " it compares the string entered with every single element of "compare" and check if it matches? I have tried doing comparisons but it always gives me an error saying " ISO C++ forbids comparison between pointer and integer [-fpermissive]|"