-3

I'm trying to create a system which receives a password to give you access to a certain file. now I'm having trouble at the start. is there any variable that I can use to combine both numbers and letters? for example something that will store the password "25j3d3". Thank you for your time.

1 Answers1

2

You don't need to store the individual character types in separate variables (letters, numbers, punctuation) etc. separately. An std::string can hold all character types (it is even binary safe):

std::string password = "abc.,+123\xFF";

On a tangent, for storing and processing passwords, obfuscating your code may be a desired effect.

Govind Parmar
  • 20,656
  • 7
  • 53
  • 85