c++ - Iterating over char* error no conversion from char* to int -
i'm iterating on char* follows, on line indicated, i'm getting error c2446 '!=' no conversion char* int.
int errorlinenumber = 0; char* json; //this long json multiple \n's in it. int offset = erroroffset; char* p = json + offset; while (*p-- != '\n' && offset--); //check gives offset on error line , not char position of end of last line before error errorlineoffset = erroroffset - offset; //get offset on error line //count lines json error long errorlinenumber = 0; while (*p!= json) //this error line errorlinenumber += *p-- == '\n';
i looked @ conversion const char tchar, it's little different, , looked @ conversion const char int, still don't think same issue, unless i'm missing something.
that great if had idea i'm missing. thanks!
in line
while (*p != json)
you compare *p
of type char
json
, which, according code above should pointer, assume of type `const char*. should
while (p != json) ...
Comments
Post a Comment