Kod:
#include<iostream>
usingnamespace std;
classsinif{
public:
char *isim, *soyisim;
sinif(char* p,char *c){
isim = p;
soyisim = c;
}
sinif(){}
}x;
int main(){
char a[55], b[55]; cin >> a >> b;
sinif nesne(a, b);
FILE *k = fopen("deneme.dat", "a+");
fwrite(&nesne, sizeof(sinif), 1, k);
fflush(k);
fclose(k);
k = fopen("deneme.dat", "r");
fread(&x, sizeof(sinif), 1, k);
cout << x.isim << " " << x.soyisim << endl;
char y; cin >> y;
return 0;
}