hello frndzz...
just wrote a piece of code in c++....bt this didnt create any .DAT file as expected.....dun knw wats wrng....
#include<fstream>
#include<iostream>
using namespace std;
class person
{
int age;
char name[40];
public:
void get()
{
cout<<"enter age:";
cin>>age;
cout<<"enter name:";
cin>>name;
}
void show()
{
cout<<"age is:"<<age<<endl;
cout<<"name is:"<<name<<endl;
}
};
int main()
{
fstream file;
person pers;
char ch;
file.open("asssd.DAT",ios::app|ios::out|ios::in|ios::binary);
do
{
pers.get();
file.write(reinterpret_cast<char*>(&pers),sizeof(pers));
cout<<"do another:";
cin>>ch;
}while(ch=='y');
system("pause");
return 0;
}