0

How to make a string reverse of a string a password

21st Apr 2018, 12:57 PM
Take
Take - avatar
5 Respostas
+ 3
With std::reverse.
21st Apr 2018, 12:59 PM
Timon Paßlick
+ 3
Bebida Roja iterator, not pointer, but yes.
21st Apr 2018, 1:11 PM
Timon Paßlick
+ 2
there is a std::reverse function located in the <algorithm> library, which takes the begin and the end pointer, and reverses the content from beginning to end. For example, #include <algorithm> #include <string> // Needed libraries std::string str { "mystring" }; // Initialize str std::reverse(str.begin(), str.end()); // Reverses content of str cout << str; // Outputs "gnirtsym"
21st Apr 2018, 1:02 PM
Bebida Roja
Bebida Roja - avatar
+ 1
Well, what's a password? Nothing but a string. In a real application, you should hash it, though.
21st Apr 2018, 1:15 PM
Timon Paßlick
0
how to make it a password
21st Apr 2018, 1:13 PM
Take
Take - avatar