using this code:
but nothing goes in the file :...

ofstream fileBook("allbooks.dat",ios:ut);

if(!fileBook){
clrscr();
gotoxy(30,15);
cout<<"File not opened"<<endl;
cout<<"Press <ENTER>";
getch();
a.libm();
}

cout<<"Book Name:"<<endl;
cin >> book_name;
cout<<"Book Author"<<endl;
cin>> book_author;
cout <<"Book Publisher"<<endl;
cin >> book_pub;
cout<< "Book Price"<<endl;
cin >> book_price;



fileBook<<book_name<<' '<<book_author<<' '<<book_pub<<' '<<book_price<<'\n';
cout<<"IN FILE:"<< endl;