strcmp problem I'm having...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
void inCript(string message) {
//Feed the message to be encrypted
    int num;
    int mesLen;
    const char* mesLet; //The chars to be compaired are mesLet and a
    const char* a;

    mesLen = message.length();
    num = 0;
    mesLet = message.at(num);// Here I set mesLet and a to their vaules
    a = "a";


    while (num > mesLen) {

        cout << "Started" << endl;

        if (strcmp (mesLet, a) == 0) // I am trying to compare mesLet to the 
char a
        cout << ":1:";
        else
        cout << "Not a" << endl;

        num = num + 1;
        cout << "Ended" << endl;
    }
}


Mind you this is just a subroutine that I have.

The error that I keep getting is
|error: invalid conversion from 'char' to 'const char*' [-fpermissive]|

Depending what I do I also get that error for the strcmp if statement and when I try to set const char mesLet and const char a to their values...

Does anyone know what I might be doing wrong?
This doesn't have anything to do with strcmp.

On line 10 you attempt to assign a char to a pointer. Don't do that.
Topic archived. No new replies allowed.