I edited your question and moved the code to the "what I've tried" section and added some indentation that was either lost or non-existent. It seems there is a missing curly brace at the end. Also, some of the the other braces are unnecessary.
Here is a revised version with some of the braces eliminated and the spacing adjusted. It also returns a boolean variable to indicate whether it worked or not.
By the way, I have never written code that checks for EOF on writing. Unless you have a fixed length file that can never grow I don't think it will ever happen. For this reason I have commented it out.
ofstream fout( "project.dat", ios::binary );
if( ! fout )
cout << "Enter the number of records to be entered";
cin >> N;
for( i = 0; i < N; i++ )
fout.write( (char*)&c, sizeof(c) );