gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

OffTopic > what do headers do?

#22344 - bean_O_ - Sat Jun 19, 2004 3:16 am

I might be on the wrong forum but plz answer me anyway

#22347 - dagamer34 - Sat Jun 19, 2004 3:52 am

What kind of header? There are lots of them.
_________________
Little kids and Playstation 2's don't mix. :(

#22351 - tepples - Sat Jun 19, 2004 5:01 am

In general, headers give a program some kind of information as to how to interpret the rest of the file. They may state the size of the file, the size of each piece of the file (such as the size of each scanline), the order of pieces, the compression format, or any of several other things that affect interpreting the file into a machine-usable copy of the work that the file represents. Headers usually precede the data, but in some file formats, headers can come at the end of the file.

Or do you refer to header files in C or C++ code?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#22355 - sgeos - Sat Jun 19, 2004 5:34 am

In C, when I say:
Code:
#include <stdio.h>
that is more or less the equivalent of find stdio.h, and copy/pasting the entire file in at that spot. The advantage is that if you change the contents of the file, the modified file is used. You can put anything you want in a header.

Perhaps you meant to ask "What should headers do?" or "what should headers contain?"

-Brendan