invalid conversion from `const char*' to `char*' .

invalid conversion from `const char*' to `char*'
 
 今天编译MRF-benchmark的时候,编译出现错误
char *dot = strrchr(filename, '.');

strrchr的第一个参数是const char*类型,filename是const char*类型,改成下面的就通过编译了:

char *dot = strrchr(const_cast<char *>(filename), '.');
 
 

你可能感兴趣的:(invalid conversion from `const char*' to `char*' .)