我在borland c ++编译器中编译并执行了以下c代码。它完美地工作但它在visual c ++ 6.0编译器中不起作用。要使它在visual c ++ 6.0中运行会有什么变化?
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <ctype.h>
int main()
{
char buffer[256] = {0};
char password[] = "password";
char c;
int pos = 0;
printf("%s", "Enter password: ");
do {
c = getch();
if( isprint(c) )
{
buffer[ pos++ ] = c;
printf("%c", '*');
}
else if( c == 8 && pos )
{
buffer[ --pos ] = '\0';
printf("%s", "\b \b");
}
} while( c != 13&& pos < 256 );
if( !strcmp(buffer, password) )
printf("\n%s\n", "Logged on succesfully!");
else
printf("\n%s\n", "Incorrect login!");
return 0;
}