Ok i got it working now.. thanx.. mind for one more questions..
what im tring to do.. is once they have inputed the wrong, numbers or letters... i what the programm to show me the letter or number that i have inputed wrong.. is this possialbe?
here is the fix of my code
Code:
int main( )
{
int index;
int c;
char buff[MAX];
char buf[MAX];
char *file = "1.txt";
FILE *fp;
if(( fp = fopen( file, "r" )) == NULL )
{
printf( "-error: could not find file" );
exit( 1 );
}
printf( "Enter numbers:\n" );
fgets( buf, MAX, stdin );
fgets( buff, MAX, fp );
for( index = 0; index < MAX; index++ )
{
if( buff[index] == buf[index] )
{
if(!( strcmp( buf, buff )) == 0 )
{
printf( "-error: Could not compare inputs" );
break;
}else{
printf( "%s", buff );
break;
}
}else{
printf( "WRONG\n" );
break;
}
}
getchar( );
return 0;
}
Please remember.. that im still a newbie here tring to get up to your level