password via istream

This is a discussion on password via istream within the C++ Programming forums, part of the General Programming Boards category; to be short, i need a (way/code preferably a manipulator of i stream..)to input a password(string) form the user without ...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Location
    india->tamil nadu
    Posts
    18

    Thumbs down password via istream

    to be short, i need a (way/code preferably a manipulator of i stream..)to input a password(string) form the user without echoing it on screen...no library functions has to be used e.g. getpass() of the nonstandard conio.h

    plz..suggest yr ideas n ask me if any doubts.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,758
    I believe this is not possible.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Apr 2007
    Location
    india->tamil nadu
    Posts
    18
    i have asked the same qn. to many many people...but all hav replied it as "not possible".
    all i want is to toggle echoing on and off the std ostream..if this is achieved then the problem is done...

  4. #4
    Registered User
    Join Date
    Apr 2007
    Location
    india->tamil nadu
    Posts
    18
    i have an idea but right now dont know how to implement it..
    first the standard output buffer is changed to a local buffer.
    now the string is read..it would not get echoed on the screen(std o/p device as the buffer has been changed)..
    now the standard buffer is restored..

  5. #5
    Registered User
    Join Date
    Apr 2004
    Posts
    173
    This is platform dependent issue - you need to turn it off in a terminal/shell or using a system-dependent function.
    The cost of software maintenance increases with the square of the programmer's creativity.

  6. #6
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    Have you tried a google? But I think laserlight is correct in his assumption. There is no standard way to do that.

    Oh and congrats on your new Mod positon laserlight!
    I'm just trying to be a better person - My Name Is Earl

  7. #7
    Registered User
    Join Date
    Apr 2007
    Location
    india->tamil nadu
    Posts
    18
    Is there any other way to implement this...?

  8. #8
    Registered User
    Join Date
    Apr 2007
    Location
    india->tamil nadu
    Posts
    18
    hey guys i tried it in google, comp.lang.c++ etc...all say there is no standard way...but guys i found this actually in Bjarne Stroustrup's book...so there is a way of achieving this...yet it is unknown..!

  9. #9
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,758
    but guys i found this actually in Bjarne Stroustrup's book...so there is a way of achieving this...yet it is unknown..!
    What exactly did Stroustrup say?

    Oh and congrats on your new Mod positon laserlight!
    Thank you.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  10. #10
    Registered User
    Join Date
    Apr 2007
    Location
    india->tamil nadu
    Posts
    18
    the actual question was to create two stream manipulators that toggles the echoing on and off.

  11. #11
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,758
    the actual question was to create two stream manipulators that toggles the echoing on and off.
    Kindly provide the relevant quote from the book.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  12. #12
    Registered User
    Join Date
    Apr 2007
    Location
    india->tamil nadu
    Posts
    18
    sorry i don remember the entire question.
    its on the exercise section of this book.(at the end of chapter 21.Streams)

    The C++ Programming Language 3rd ed
    from the Creator Of C++,
    Bjarne Stroustrup.
    Addison Wesley Publications.

  13. #13
    Registered User
    Join Date
    Apr 2007
    Location
    india->tamil nadu
    Posts
    18
    hey did any one find the answer?

  14. #14
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Have you provided the exact quote yet?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  15. #15
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,558
    We're still waiting for you to cite your references.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading a password from a file.
    By medeshago in forum C Programming
    Replies: 15
    Last Post: 12-21-2008, 06:20 AM
  2. [Q]Hide Password
    By Yuri in forum C++ Programming
    Replies: 14
    Last Post: 03-02-2006, 02:42 AM
  3. written command line password generator
    By lepricaun in forum C Programming
    Replies: 15
    Last Post: 08-17-2004, 08:42 PM
  4. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 04:44 PM
  5. password
    By hammers6 in forum C Programming
    Replies: 1
    Last Post: 10-10-2001, 12:14 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21