QChar is a class in Qt library and is used to represent a single Unicode character. The toAscii() function of QChar converts the character to its ASCII equivalent.
Example 1: Convert the character 'A' to its ASCII equivalent
QChar character = 'A';
char ascii = character.toAscii();
Example 2: Convert a string to Ascii characters
QString str = "Hello";
for(int i = 0; i < str.size(); i++) {
QChar character = str[i];
char ascii = character.toAscii();
}
These examples are using the Qt library for C++ programming language.
C++ (Cpp) QChar::toAscii - 30 examples found. These are the top rated real world C++ (Cpp) examples of QChar::toAscii extracted from open source projects. You can rate examples to help us improve the quality of examples.