Hi Guys..
I have a problem in tellg() function..
When I open file in Binary mode , It returns true value,but when I open in default mode it returns false value.I can't understand what has happened ...(the problem is in this code) :
for(int t=1;t<size;t++){
char ch=input.get();
codes_list[t].symbol=list[t].symbol=ch;
input>>list[t].q;
list[t].right=list[t].left=0;
input.get();
}
position=input.tellg();
it is so interesting that when I add cout<<input.tellg() in the scope it returns very bad value and many -1 !
(aboat code : it read data from file that the order is : (char)(int)(space) ...and code_list and list are structures .
and my another problem is when I put open file in binary mode.. it reads some unknown characters for example it reads 26 and 13 that causes bad works of my code.