I'm trying to use strerror_r to get the error from the socket function ,but the code is not compiling .i'm getting the error as invlaid conversion from char * to an int. i have included errorno.hand string.h in my code and i'm using eclipse ide running on ubuntu 12.04 .The code is as below.
int err;
char buffer[50];
result=connect(socketHandle, (struct sockaddr *)&remoteSocketInfo, sizeof(sockaddr_in));
if(result==0)
{
printf("\n connect success ");
}
else if(result==-1)
{
err = strerror_r(errno,buffer,50);// error in place
printf("%d",err);
}
strerror_ris returning achar *notint.errorno.handstring.hin my code" -- Then please show us code with those#includedirectives. It's always better to show (copy-and-pasted) code than to describe what your code looks like. (If you really includederrorno.h, you would have gotten an error message; it'serrno.h.) And please copy-and-paste the error message rather than re-typing it. Seemingly subtle nuances can be important. sscce.org