I have the following code in C and C ++
static void callback(char const* fname, int status) { static char const* szSection = fname;
In C ++, this compiles without warning or error. In C, I get a compilation error "initializer is not constant." Why is it different from two? I am using the VC9 compiler for Visual Studio 2008 for both.
I am trying to take the file name as input and set the file path for the first time. All subsequent callbacks are used to check for updates in the file, but the path itself cannot be changed. Am I using the right variable in char const *?
source share