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.
bool writeinto()
{
club c;
int N,i;
ofstream fout( "project.dat", ios::binary );
if( ! fout )
{
cout<<"Error";
return false;
}
{
cout << "Enter the number of records to be entered";
cin >> N;
for( i = 0; i < N; i++ )
{
c.enterdata();
fout.write( (char*)&c, sizeof(c) );
}
fout.close();
}
return true;
}