|
-
Mar 1st, 2005, 05:54 AM
#1
Thread Starter
transcendental analytic
odd behaviour of fread
Two things, fread reads 1 byte when its suppose to read 4, but get no errors nor has it reached end of file, and the other thing is that it jumps to 245, can anyone explain this?
getpos(f,&pos);
Debug << pos <<endl;// says 0
size_t s;Debug<<fread(&s,sizeof(size_t),1,f)<<endl;_node.resize(s);//says 1
Debug<<ferror(f)<<endl;//says 0
Debug<<feof(f)<<endl;//says 0
fgetpos(f,&pos);
Debug << pos <<endl;//says 245
fread(&s,sizeof(size_t),1,f);_edge.resize(s);
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|