1. >Sorry, that's the best I can do as a newbie programmer.
No biggie, just don't take the following review the wrong way.

>float a_a, b_b;
It's best to choose names that are meaningful to other people and yourself in the future. It saves you all kinds of heartache later on. Also, for multiple reasons but mostly because double is the default floating-point type, you should always use double unless you have a compelling reason not to.

>b_b = 123
Don't forget the trailing semicolon.

>if ( a_a == b_b ) {
I highly recommend not using floating-point data types until you know how to use them correctly. This isn't a flame or anything, it's just that floating-point is incredibly subtle and difficult to work with for just about everyone. If you aren't familiar with the pitfalls then you'll have weird problems that you won't know how to deal with.

In this case, comparing floating-point values for equality is inaccurate because the binary representation of floating-point is inherently imprecise. If you have a_a=1.1 and b_b=1.1 then they still might not be equal if a_a is 1.100001 and b_b is 1.100000 internally.

The solution is to do a "close enough" test that would be dreadfully confusing at this point in your studies, which brings me back to the initial recommendation.

>else if ( a_a != b_b ) {
else nothing is equivalent to else a_a != b_b.

>cin.get();
Good idea, but because you do this for every path taken, you can place it outside of the if statement.

Ignoring the floating-point issues, here's your updated code:
Code:
```#include <iostream>

using namespace std;

int main()
{
double pass, input;

pass = 123.0;
cin>> input;
cin.ignore();

if (input == pass)
cout<<"Correct!"<<endl;
else
cout<<"Incorrect"<<endl;

cin.get();
}```

2. ## Yeah...

Yeah...Could you explain the whole doublepass thing. Also, you may beleive the whole thing is ugly, but if you take out the spaces(which are put there automatically), it looks a lot neater. Thanks for the cin.get(); outside the if statement suggestion, it helps me learn how c++ works. How could I take this the wrong way? I'm happy that after 2 days I can offer an answer to a question answered by someone else! And yes, it may not be too pretty, but I am still happy that the syntax works!

3. >Could you explain the whole doublepass thing.
pass and input are just more informative names than b_b and a_a, respectively.

>How could I take this the wrong way?
You would be surprised at the ways my posts have been misunderstood in the past.

4. so what does the command 'double' do?

5. >so what does the command 'double' do?
Basically, the same thing as float. The only difference is that double might be able to hold bigger or more precise values.

6. Ok...The coding is simpler, but the main obstacle to get over now is that the password can still only be numbers...Got any ideas?

7. You want string data. The easiest way to do what you want in C++ is to use the string class, and getline:
Code:
```#include <iostream>
#include <string>

using namespace std;

int main()
{
string pass, input;

pass = "x04G9Ytm";
getline(cin, input);

if (input == pass)
cout<<"Correct!"<<endl;
else
cout<<"Incorrect"<<endl;

cin.get();
}```
Compare this program with the one I posted earlier. Spot the differences and try to figure out the purpose of each of them.

8. Thantos:
MD5 is a hash scheme, not an encryption scheme. There is a very important difference between the two.

9. Yes but you can use it to encrypt a password since only one way is needed.

10. Isee what you mean now.

11. ## Strings....

That's what I thought would be needed. However, I am still learning basic concepts. After trying to figure out the whole string situation for half an hour, I decided to give up and ask for someone else's input. Thanks for the code, it helps explain concepts of c++. Very valuable.

12. If you're really looking for an MD5 scheme, then here would be a good reference:
http://www.codeguru.com/code/legacy/...ms/md5_src.zip

If you don't have visual C++, you can still open the source files in notepad and go from there. You might not want to start out with this if you're a beginning coder and are just learning still, but regaurdless this will do what you want to do if you read/modify the code correctly

If you're just trying to get past notepad readers, then just implement a 1-1 crypto scheme, it wouldn't be that hard really, say your password is a char array of size 11 including the null terminator, here's what it would look like:
Code:
```#include <iostream>

int main(int argc, char **argv)
{
/* Program: 1-1crypto.cpp
Author: Tronic
Description: Detailing a simple 1-1 crypto algo.
Compiled In: Visual C++ 7
/*
bool access = false;/*mainly use this if you want to change/expand this code*/
int successCounter = 0;
char matchCipher[11] = "abcdefghij";
for(int i = 0; i < 10; i++)
matchCipher[i]++;
char plainCipher[11] = { 0 };
std::cout << "> ";
std::cin >> plainCipher;
for(int i = 0; i < 10; i++)
plainCipher[i]++;
for(int i = 0; i < 10; i++)
{
if(!(plainCipher[i] == matchCipher[i]))
{
access = false; //Just in case something goes wacko.
}
else
successCounter++;
}
if(successCounter == 10)
{
bool access = true;//Might need this for later use.
std::cout << "Access Granted";
}
return 0;
}```
-The main holes in this are successCounter, buffer overflow when getting input for plainCipher because of no bounds checking, and the simple scheme.

Prelude, what makes != more precise with floating points than == ? I haven't ran into this problem yet lol, good that I find out about it now from someone.

13. >>what makes != more precise with floating points than ==
I don't think it is. Otherwise, you could just do:
if(!(x != y))

14. Well, from what Prelude says it is, but that confuses me since I don't exactly know the steps behind != and ==. I would assume that == and != have a different precisity, but that's just an assumption.

15. Originally Posted by Tronic
Well, from what Prelude says it is
It has nothing to do with != being more accurate than ==, what Prelude was addressing was the fact that a floating point number is inherently inaccurate, more of a "guess". A double is more accurate of a guess than a float, but neither is 100% exact.

For either of them, the computer may store the number 1.1 as 1.10001, or it may store 1.1 as 1.10000. It may even store two float variables defined at the same time with these two different values. So, while you print out 1.1000 for both numbers, because of the possible inaccuracy, testing for equality of those two floats may turn out false (because 1.10001 is NOT equal to 1.10000).

This means that testing for equality ( == ) is most likely to be false for any two given float variables, while testing for inequality ( != ) is most likely to be true for any two given float variables.

I have played with the way floating point variables are stored internally with gcc and it's fascinating (in a morbidly geeky sort of way).