Program Body
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;
class theOriginals{
char name[500];
int saireline;
public:
theOriginals(){
strcpy(name,"enter name of Original");
saireline =1000;}
theOriginals(char *name,int saireline){
strcpy(this->name,name);
this->saireline=saireline;
}
void whichoriginal(){
cout<<"this is "<<name<<" Mikelson and its sires are about "<<saireline<<endl;
}
};
int main(){
theOriginals original("elijah",4003);
fstream file("originals",ios::binary|ios::in|ios::out|ios::trunc);
if(!file.is_open()){
cout<<"Error occured while opening the file"<<endl;
}else{
file.write((char*)&original,sizeof(theOriginals));
file.seekg(0);
theOriginals vamp("klaus",100000);
vamp.whichoriginal();
original.whichoriginal();
}
}
The originals
its an american drama serial of vampires.
los archivos binarios son muy interesantes ya que sin ellos no fueramos lo que somos ahora, con el simple hecho de solo traducir datos
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Zbrdst
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit