A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 5 years ago

Can anyone give me a sample password verification program in c++? The user should type a password and the compiler should check if its right or wrong and display. -- advance thanks.

  • This Question is Closed
  1. Owlfred
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Hoot! You just asked your first question! Hang tight while I find people to answer it for you. You can thank people who give you good answers by clicking the 'Good Answer' button on the right!

  2. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    You mean when user types password should be shown in screen ????if not it is just like comparing two strings using strcmp

  3. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    the original password is already in the program. the compiler just need to verify if the user entered password is right.

  4. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    #others like stdio and all include <string> int main() { string s1,s2; #lets consider s1 has password and s2 has entered password. if(s1.compare(s2)==0) { #print equal } else { do whatever you want } return 0; }

  5. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ya but how to compare two arrays? (one array is the original password and the other one is the one entered by the user.)

  6. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    hello?

  7. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    you mean char a[34],b[45]; if (strcmp(a,b)==0) print true else print false

  8. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    thanks

  9. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @geo:I would like to know more about the result,don't forget to use string header file(<string>

  10. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ok

  11. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    strcpy didnt work it is just comparing the first letter of the password. not the entire string. can you please give the c++ program for this?

  12. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    hello

  13. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Check this out http://www.linuxquestions.org/questions/programming-9/comparing-char-arrays-46831/

  14. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    thanks a lot

  15. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.