Generating 10-character passwords, with 3-6 digits and 3-6 uppercase letters, in C++
Your passwords will be biased, with more letters appearing towards the front of the password and more digits towards the end.

A better approach would be to determine how many digits you will have in the password. Then, for each character, determine if it should be a digit based on the number of digits you want to have and the number of characters left to fill by checking if (random(characters_left) &lt; digits_left).  Then select either a random digit or letter for that position.

When you declare pass, you don't need to pass it an empty string.  It is default constructed as empty.

std::string pass;