i tried reading a file using fstream class object.
the content of the file was : "i like c++ programming" (without the double quotes)
now when i access the file in input mode to print its contents, i'm getting the following output : "i like c++ programmingg" (without the double quotes)
the last g is printed twice
also after running my code when i'm printing file.tellg(), i get -1 whereas i expect the last bit of the file(it's size), i.e. 22
following is the code for my program :