S
Someonekicked
here is a part of the program thats not working:
-----------------------------------------------------------
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
int current = 8526336;
ofstream outTemp("primes_temp.txt", ios::binary);
outTemp.write( reinterpret_cast<const char *>(¤t), sizeof(int) );
outTemp.close();
ifstream inTemp("primes_temp.txt");
current = 0;
inTemp.read(reinterpret_cast<char *>(¤t), sizeof(int));
cout << current << endl;
return 0;
}
-----------------------------------------------------------
ok, if i change 8526336 to 8526334, or another number, program works fine,
and i will get that number as output, but whats so special about 8526336?
why i dont get an answer?
thx in advance for any help or suggestions.
-----------------------------------------------------------
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
int current = 8526336;
ofstream outTemp("primes_temp.txt", ios::binary);
outTemp.write( reinterpret_cast<const char *>(¤t), sizeof(int) );
outTemp.close();
ifstream inTemp("primes_temp.txt");
current = 0;
inTemp.read(reinterpret_cast<char *>(¤t), sizeof(int));
cout << current << endl;
return 0;
}
-----------------------------------------------------------
ok, if i change 8526336 to 8526334, or another number, program works fine,
and i will get that number as output, but whats so special about 8526336?
why i dont get an answer?
thx in advance for any help or suggestions.