This program below returns -1 everytime. However, it should retun 5 as the file "Hello.txt" has the word "Hello" which has length 5.
#include<iostream>
#include<fstream>
using namespace std;
void main()
{
ifstream File("d:\Hello.txt");
char arr[10];
File.read(arr,10);
//this should return 5, as Hello is 5 characters long
cout<<File.tellg()<<endl;
File.close();
system("pause");
}