unsigned i = 100; QString str("text" + i); //textd 

Must be text100;

    1 answer 1

    It did not convert int to a string, it just added a character. 100 is the character code d. Your problem is just that it was necessary to translate i into a string, and not to prohibit it. :) Itoa is usually used for translation, but strtol is still preferred.

    • one
      Why engage in such perversion when there is a QString :: number ()? =) unsigned i = 100; QString ("text") + QString :: number (i); - free_ze