ok, in the first link, on the second example, is what i need. but i dont understand it...
Code:
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
#include <iostream.h>
int main()
{
int ch;
char pword[BUFSIZ];
int i = 0;
cout<<"Enter your password"<<flush;
while ((ch = getch()) != EOF
&& ch != '\n'
&& ch != '\r'
&& i < sizeof(pword) - 1)
{
if (isalnum(ch)) //i have never seen 'isalnum' before
{ //does it just check if 'ch' is an int?
cout<<(char)ch<<flush; //now what i realy dont understand
pword[i++] = ch; //is, this will keep accepting input
} //untill enter is pressed, why?
}
pword[i] = '\0';
cout<<"\nYou entered "<<pword;
return 0;
}
i have edited it a bit, just so i know whats going on.
the thing which i dont understand is in the comments in the code..