[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c++

Password input program

neilsolent

11/26/2008 9:04:00 PM

Hi

The following test program is supposed to wait for the user to input a
password, then echo it to the screen. It works fine on Solaris 10.
However, on Linux it clears the screen first! Can anyone explain how I
can modify it to work (not clear the screen) on Linux?

Thanks!

///////////////////////////////////////////////


#include <curses.h>

int main(int argc, char* argv[])
{
char buffer[16];
filter();
WINDOW* win = initscr();
noecho();
wgetnstr(win, buffer, 15);
endwin();
buffer[15] = 0;
printf("%s\n", buffer);
return 0;
}
2 Answers

Ian Collins

11/26/2008 9:04:00 PM

0

neilsolent wrote:
> Hi
>
> The following test program is supposed to wait for the user to input a
> password, then echo it to the screen. It works fine on Solaris 10.
> However, on Linux it clears the screen first! Can anyone explain how I
> can modify it to work (not clear the screen) on Linux?
>
Try comp.unix.programmer.

--
Ian Collins

neilsolent

11/26/2008 9:13:00 PM

0

OK - thanks. Good idea!