Hi all, I have two member function definitions below, I am having trouble as one accepts a non const pointer but const string, and the other accepts a non const pointer but a non const value. When I try to pass const char* recievedstring to readString() the compiler throws an error. I did try to look into const_cast but no luck. Alternatively I thought about modifying the header file function defition to remove the const requirement. It's probably something simple so any tips welcome! Thank you
Well I would imagine that receivedString points to the memory allocated for the received string and so that memory cannot be marked as const. Hence char * and not const char*. So any memory address passed to readString must be non-const marked.