V
vivekian
Hi,
This is the part of the code am trying to compile to :
void Server::respondToClient ( std::string response )
{
....
....
if ((numbytes = sendto ( sockFd_ , response , sizeof(response) , 0,
(struct sockaddr *)&clientAddr, sizeof (clientAddr))) == -1){
perror ("sendto");
exit (1) ;
}
....
}
This is the function prototype :
ssize_t sendto(int socket, const void *message, size_t length,
int flags, const struct sockaddr *dest_addr,
socklen_t dest_len);
Not sure how to go about typecasting the 'std::string' to 'const void
*' .
Thanks in advance ,
vivekian
This is the part of the code am trying to compile to :
void Server::respondToClient ( std::string response )
{
....
....
if ((numbytes = sendto ( sockFd_ , response , sizeof(response) , 0,
(struct sockaddr *)&clientAddr, sizeof (clientAddr))) == -1){
perror ("sendto");
exit (1) ;
}
....
}
This is the function prototype :
ssize_t sendto(int socket, const void *message, size_t length,
int flags, const struct sockaddr *dest_addr,
socklen_t dest_len);
Not sure how to go about typecasting the 'std::string' to 'const void
*' .
Thanks in advance ,
vivekian