Why do I get corrupt output on my file?
- by Martin
I have a simple program which I have compiled in both MinGW and Visual C++ 2008 Express, and both give an output file larger than 88200. When I set s = 0, both programs work as expected. What am I doing wrong?
#include <fstream>
using namespace std;
int main(int argc, char *argv[])
{
int i;
short s;
fstream f;
…