[solved] trying to test if a qchar is equal to "[" and I get thrown a between pointer and integer error
-
wrote on 15 Aug 2014, 02:22 last edited by
Durhur...erp
=='['
Old Post
@
Error:
C:\Dev\DiffMatchPatch\diffmatchpatch.cpp:303: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
@
on this line specifically:
@
if (character.toLatin1() == "[")
@
FULLCODE:
@
QString line = in.readLine();
while (!in.atEnd())
{
line = in.readLine();//Read Character's if length !=0 int charPosition = 0; //while (line.length()) while (charPosition <= line.length()) { //const QChar character = QString::operator [](charPosition) line; //const QChar character = QString:: //QChar character = line[](charPosition); QChar character = line[charPosition]; //string conversion? //http://qt-project.org/faq/answer/how_can_i_convert_a_qstring_to_char_and_vice_versa //QString characterString = character.toLatin1(); if (character.toLatin1() == "[") { bracketCount++; }; charPosition++; } lineCount++;
}
in.resetStatus();
@
1/1