hi, i have this simple code, that compiles on visual studio 2005.When i try to run the executable through visual studio {pressign ctrl+F5} it does nothing{although the test.txt has size of 1kb}, when i run the exe through the command prompt the program works fine...
Does anyone know why this is happening??
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
long start,end;
ifstream myfile ("test.txt", ios::in|ios::binary);
start = myfile.tellg();
myfile.seekg (0, ios::end);
end = myfile.tellg();
myfile.close();
cout << "size of " << "test.txt";
cout << " is " << (end-start) << " bytes.\n";
return 0;
}
thanks for your time,
NA