Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved] trying to test if a qchar is equal to "[" and I get thrown a between pointer and integer error
Forum Update on Monday, May 27th 2025

[solved] trying to test if a qchar is equal to "[" and I get thrown a between pointer and integer error

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 584 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thistleknot
    wrote on 15 Aug 2014, 02:22 last edited by
    #1

    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 Reply Last reply
    0

    1/1

    15 Aug 2014, 02:22

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved