Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
This program is real rubbish, old style headers, conio, half of the code is commented out, system("pause") (don't use it), etc...
My recommendation is: migrate to standard C++ first, they really should make it a forum rule...
BTW, Does it really hurt you to use code tags:
1) in the Rules you were asked to read when you registered
2) in the text at the top of this forum
3) in the announcement at the top of this forum titled Please use BB Code and Inlinecode tags
4) in the sticky post above titled Read Me: Read This Before Posting
5) any place CODE tags were used
6) Even on the background of the box you actually typed your message in
(as already discovered by valinux):
If you still really want to fix your code, then you should add a check before adding the character to the variable, otherwise there will be an ENTER in the pass-string where you compare the real password to, always resulting in a Non Confirmed message, a simple check might look like this:
if( a != 13 ) pass += a; :)
tux4life
Nearly a Posting Maven
2,350 posts since Feb 2009
Reputation Points: 2,134
Solved Threads: 243
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
tux4life, I challenge you to write the same program with the same features and restrictions and show me how it's so much better than mirfan00's that he deserved all of that harassment. You're quick to mouth off, but can you back it up with your own perfection?
The only old style header is , and even though it's officially deprecated, it's not going away any time soon because then compatibility with C would go out the window.
There's no way to replace typed characters with a star using standard code. To do that you have to use something that isn't portable, and conio is as good a choice as any for a toy program.
Only 3 lines out of over 40 are commented out. I didn't get good grades in grade school math classes, but I'm pretty sure 3 isn't even close to half of 40.
You forgot to say that should be included because the code uses the standard C++ string class. And you forgot to say that '\r' is a portable replacement for 13. For all the complaining about old style headers, you forgot to say that the only code using them is commented out so both can be removed. I see you complaining about the same things over and over, and ignoring other things that are in the same league or worse. It kind of makes me think that you don't really know what you're talking about and just copy people who do.
Well, when I replied his code wasn't surrounded by code tags, well, you can see the result in my post :(
tux4life
Nearly a Posting Maven
2,350 posts since Feb 2009
Reputation Points: 2,134
Solved Threads: 243