Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Qt Error help with char and const *char

$
0
0
I have the following error with Qt. Can anybody help me with these Qt function errors and how to fix it?

error: request for member 'begin' in 'answer', which is of non-class type 'char*'
error: request for member 'end' in 'answer', which is of non-class type 'char*'
error: invalid conversion from 'char' to 'const char*'


QString qStr = plainTextBox -> text();
QByteArray qba = qStr.toAscii();
char *answer = qba.data();
for (std::string::iterator it = answer.begin(); it != answer.end(); ++it){
     if (isalpha(*it)){
          *it = tolower(*it);
          *it = ((a*(*it -'a')+B)/>/>/>/> % 26)+'a';
          *it = toupper(*it);
          qStr = QString::fromAscii(*it);
          encodedTextBox -> setText(qStr);
      }
}


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>