Hi I am getting an error with some code, it compiles fine on linux but it is throwing an error on solaris, it is to do with strtok_r, the following is the error message:
sku_cache.cpp:150: implicit declaration of function `int strtok_r(...)'
sku_cache.cpp:150: assignment to `char *' from `int' lacks a cast
The code in question is:
char *svptr;
char *s;
char cont[input.length()];
const char *delim = " ";
const char *sdelim = "0123456789";
sprintf(cont, "%s", input.c_str());
s = strtok_r(cont, delim, &svptr);
As I said this compiles without error on linux but using solaris 8 it complains, on checking the man pages on both machines:
Solaris:
char *
strtok_r(char *str, const char *sep, char **last);
Linux:
char *strtok_r(char *s, const char *delim, char **ptrptr);
Any help would be greatly appreciated.
Thanks
Ben