Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't need a 'data' variables when I read directly from file. For example: "fread( (void *)&i, sizeof(i), 1, file);". Works also with (packed) structs. For the solution as given in the article I need now a second variable 'data' first to buffer the information I read from file.

edit: I mention this case as it covers around 90% of the cases I've seen on a quick check over a codebase I'm working with (Irrlicht). Swapping endian is nearly always done after reading in the data from a file-stream.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: