whenever i try to compile this program i get the following errors: [Error] conflicting declaration 'std::ifstream inf' [Error] 'inf' has a previous declaration as 'FILE inf' [Error] request for member 'open' in 'inf', which is of pointer type 'FILE [Error] request for member 'read' in 'inf', which is of pointer type 'FILE*
I just can't figure out how to resolve this. Can anyone help? here's my code:
whenever i try to compile this program i get the following errors:
[Error] conflicting declaration 'std::ifstream inf'
[Error] 'inf' has a previous declaration as 'FILE inf'
[Error] request for member 'open' in 'inf', which is of pointer type 'FILE
[Error] request for member 'read' in 'inf', which is of pointer type 'FILE*
I just can't figure out how to resolve this. Can anyone help? here's my code:
include "enigma.h"
include <algorithm>
include <iostream>
include <vector>
enigma::enigma() {
}
enigma::~enigma() {
for(int i=0; i<num_rotors; i++)
delete []rotors[i];
}
int enigma::FileSize(const char* sFileName)
{
ifstream f;
f.open(sFileName, ios_base::binary | ios_base::in);
if (!f.good() || f.eof() || !f.is_open()) { return 0; }
f.seekg(0, ios_base::beg);
ifstream::pos_type begin_pos = f.tellg();
f.seekg(0, ios_base::end);
return static_cast<int>(f.tellg() - begin_pos);
}
int enigma::file_do_cipher(char * infile, char * outfile, char * key)
{
init_enigma(key);
FILE inf, of;
struct stat results;
}