The way you have that written certainly should not work.
= and == differ on precedence.

What happens in the if statement is
if (FILE_1 = (fopen(nameoffile, "r") == NULL))

Not the correct
if...