You are missing parentheses here:
if (fp=fopen("crypt.txt","r")!=NULL)
The !=
operator has higher precedence than =
so the compiler sees the expression like this:
if ( fp = ( fopen("crypt.txt","r") != NULL ) )
fp
gets either 1 or 0 depending on whether fopen
returned NULL
. fp
is a pointer and 0/1 is an integer, hence the warning.
You want
if ( ( fp=fopen("crypt.txt","r") ) != NULL )