View Single Post
  #1 (permalink)  
Old August 9th, 2008, 12:58 AM
aix_kernel aix_kernel is offline
Registered User
 
Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Accepting Passwords in C++

The general way to accept passwords is to print a special character conventionally a '*' in the foreground while we store the actual character in the background.

I have done this in a TC compiler with the help of getch() function.

Under GCC, I found that the function getch() is supported by curses.h instead of stdio.h as in a TC compiler.

But when I have tried out a simple program as follows, the program gives few errors when compiled

#include<stdio.h>
#include<curses.h>

int main()
{
    int c = getch();
    return 0;
}

Could you please tell me what the problem might be and the way to solve it.

Thanks in advance.

Mandriva Rocks
Reply With Quote