Error :confused:

This is a discussion on Error :confused: within the C++ Programming forums, part of the General Programming Boards category; I am getting this wierd error: invalid conversion from `char' to ` char*' Code: void Recieve(int nBytes, int clientSocket, char ...

  1. #1
    Arggggh DeepFyre's Avatar
    Join Date
    Sep 2004
    Posts
    227

    Error :confused:

    I am getting this wierd error:
    invalid conversion from `char' to ` char*'


    Code:
    void Recieve(int nBytes, int clientSocket, char inMessage)
    {
        while (nBytes){
    	nBytes = recv(clientSocket, inMessage, sizeof(inMessage), 0);
    	}	
    }
    Keyboard Not Found! Press any key to continue. . .

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    look up what the second parameter for recv() is supposed to be. Suspect it's supposed to be a char* and you are trying to send it a char. Therefore, can't convert from char to char *.

  3. #3
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,255
    The second parameter to recv() needs to be a pointer to a buffer that will hold the data received from the socket.

  4. #4
    Arggggh DeepFyre's Avatar
    Join Date
    Sep 2004
    Posts
    227
    Thanks!
    Keyboard Not Found! Press any key to continue. . .

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21