Answer the question
In order to leave comments, you need to log in
Why did the Comparison between pointer and integer error occur?
Hi everyone! I'm learning c++builder
I got this error:
[bcc32c Error] bcbl.cpp(47): comparison between pointer and integer ('int' and 'const char *')
Code:
String str = "text,text";
if (str[4] == ",") // ошибка
Answer the question
In order to leave comments, you need to log in
Str[4] == ','
The character must be written in apostrophes, not quotes. Strings are written in quotes, for example, str == "abcde".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question