Using array of string values
-
Hello there I am working on a C++ MFC app that has a user login option and the software will store upto 15 passwords used by a user. Now i want to store each password used by a user in a string array and make sure that the user doesn't use an old password when updating the password. i.e., password once used cannot be re-used and an existing password will expire after a set number of days. The question is what kind of collection class i need to use for efficient management of old passwords? CArray?CList? CString array? Any sample code will help. Thanks in advance.
-
Hello there I am working on a C++ MFC app that has a user login option and the software will store upto 15 passwords used by a user. Now i want to store each password used by a user in a string array and make sure that the user doesn't use an old password when updating the password. i.e., password once used cannot be re-used and an existing password will expire after a set number of days. The question is what kind of collection class i need to use for efficient management of old passwords? CArray?CList? CString array? Any sample code will help. Thanks in advance.
It sounds like a trivial issue, use whichever types you're comfortable with. STL vectors and CStringArrays both leap to mind; do you need to save this data somehow? CStringArrays support CArchive but you may want to think about encryption or some other safety feature.
-
Hello there I am working on a C++ MFC app that has a user login option and the software will store upto 15 passwords used by a user. Now i want to store each password used by a user in a string array and make sure that the user doesn't use an old password when updating the password. i.e., password once used cannot be re-used and an existing password will expire after a set number of days. The question is what kind of collection class i need to use for efficient management of old passwords? CArray?CList? CString array? Any sample code will help. Thanks in advance.
If you're only storing CStrings then CStringArray[^] would be a good choice. If you're storing something else, one of the other collections probably would be more appropriate, here[^] are some examples of thier usage, there are lots of others on the web. here[^] is a link that should help you to decide which collection might be best.
-
Hello there I am working on a C++ MFC app that has a user login option and the software will store upto 15 passwords used by a user. Now i want to store each password used by a user in a string array and make sure that the user doesn't use an old password when updating the password. i.e., password once used cannot be re-used and an existing password will expire after a set number of days. The question is what kind of collection class i need to use for efficient management of old passwords? CArray?CList? CString array? Any sample code will help. Thanks in advance.
Donguy1976 wrote:
The question is what kind of collection class i need to use for efficient management of old passwords?
Since you are only dealing with 15, and only searching the collection when the user is logging in (e.g., once per day), it likely does not matter the data structure you use.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
-
Hello there I am working on a C++ MFC app that has a user login option and the software will store upto 15 passwords used by a user. Now i want to store each password used by a user in a string array and make sure that the user doesn't use an old password when updating the password. i.e., password once used cannot be re-used and an existing password will expire after a set number of days. The question is what kind of collection class i need to use for efficient management of old passwords? CArray?CList? CString array? Any sample code will help. Thanks in advance.
If you are happy with
MFC
containers then CStringArray[^] is fine. As side (though important) note, have a look at out Original's tip: "Password Storage: How to do it."[^].Veni, vidi, vici.
-
Hello there I am working on a C++ MFC app that has a user login option and the software will store upto 15 passwords used by a user. Now i want to store each password used by a user in a string array and make sure that the user doesn't use an old password when updating the password. i.e., password once used cannot be re-used and an existing password will expire after a set number of days. The question is what kind of collection class i need to use for efficient management of old passwords? CArray?CList? CString array? Any sample code will help. Thanks in advance.