Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error: passing 'const Randomize' as 'this' argument discards qualifiers [-fpermissive]
- x = randomize1(index, size);
- ^
- int randomize1 (int x, int size)
- {
- int z = qrand() % size;
- if (x==z) randomize1(x, size);
- return z;
- }
- QString GetRandomString() const
- {
- const QString
- possibleCharacters("abcdefghijklmnopqrstuvwxyz");
- const int randomStringLength = 12; // assuming you want random strings of 12 characters
- int x = -1;
- int size, index;
- QString randomString;
- for(int i=0; i<randomStringLength; ++i)
- {
- size = possibleCharacters.size();
- index = qrand() % size;
- if (x==index)
- {
- x = randomize1(index, size); // ОШИБКА ЗДЕСЬ
- }
- QChar nextChar = possibleCharacters.at(x);
- randomString.append(nextChar);
- qsrand(QTime::currentTime().msec());
- Sleep::msleep(10);
- }
- return randomString;
- }
Add Comment
Please, Sign In to add comment