Class Project

Discussion in 'C++' started by aaholland, Sep 12, 2006.

  1. aaholland

    aaholland New Member

    Joined:
    Sep 12, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I am writing a program for my college class It has to record a password, but it cant display it on the screen. It is a unix based enviroment. Does this look correct to you guys?


    Code:
     main()
    {
      int  i;
      char buffer[80];            
      initscr();                
    
      printw("Please enter a password => ");    
      refresh();                
      noecho();                
                        
      while((buffer[i] = getch()) != '\n') i++;
    
      printw("\nPassword is %s - press return to continue.",buffer);
      refresh();
      getch();
    
      endwin();                 }
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice