My tested bacteria

master
root 9 years ago
parent d1de32c0ea
commit c1dd12c407

@ -8,7 +8,7 @@ using namespace std;
int file_size(const char *filename){
ifstream ifile;
ifile.open(filename, ios_base::binary | ios_base::ate);
ifile.open(filename, ios_base::binary | ios_base::ate);
int size = ifile.tellg();
ifile.close();
return size;
@ -19,10 +19,9 @@ int main(int argc,char** argv) {
// Read my own program
ifstream ifile;
ifile.open(argv[0], ios::binary) ;
int filesize = file_size(argv[0]);
srand( time(NULL) );
int filesize = file_size(argv[0]);
int rand_byte = rand() % ( filesize + 1 );
// Devide
ofstream ofile;
string filename = tempnam(".", "bact-");

Loading…
Cancel
Save