string receiveFromServer();
this function returns a string received from some server. If an error occurred along this path (including the protocol), I want to return a NULL string. However, this does not work in C ++ (unlike java). I tried:
string response = receiveFromServer(); if (response==NULL) { cerr << "error recive response\n"; }
but it is not legal. Since an empty string is also legal to return, what can I return, will this indicate an error?
Thank you!
source share