Hi,
I'm using Qt 5.3.0 and this code is a solution to one of our assignment questions that we had to do. Please see my comments in the following extraction of code. Not sure if I understand it correctly:
else{
uName += lName;
int chars = 4 - lName.size();
if(fName.size() >= (chars +1)){ //what is the purpose of the +1?
fName.resize(chars +1);
uName += fName;
}
else{
uName +=fName;
uName += QString(5-uName.size(), '0'); //I suppose the '0' is to add zeros at the end of the string?
Bookmarks