When you run this code, the following error occurs:
syslog(LOG_ERR | LOG_USER, "%s",errorString);
cannot convert 'const string {aka const std :: basic_string} to' const char * for> argument '2 to' void syslog (int, const char *, ...) inServer.cpp / PeCounter
line 478 C / C ++ problem
I unmount the program, and the errorString value prints fine when output to stdio using cout, but when using the syslog call it will not print.
Any way to get std :: basic_string (char) as 'const char'.
source share