1

I have searched all over the internet looking for an answer to my own question, but I can't seem to find one that I can understand. With that being said, it is a multi-part question so bear with me.

  1. What is a header file in C?

  2. What does it mean to read the header for the file so you know the number of things to process?

  3. Does getting volume information have anything to do with reading the header of a the file?

Thanks guys!

tonysdg
  • 1,335
  • 11
  • 32
Edgar
  • 23
  • 1
  • 3
  • 1
    The first question is possibly a duplicate of http://stackoverflow.com/questions/1167875/header-per-source-file – tonysdg Oct 17 '15 at 20:30
  • Thank you, However That has nothing to do with the other 3 questions. – Edgar Oct 17 '15 at 20:32
  • 1
    Google. `What is a file header in c` and `volume info reading header file`. If you are not sure you understand what you read, then ask a question. – Evan Carslake Oct 17 '15 at 20:34

1 Answers1

1
  1. You write a C program to do some kind of task. For example, your C program might query the OS for volume information, and report back the results in a command prompt.

  2. "Writing a program" involves:

    a) defining the task (EXAMPLE: get volume information).

    b) Writing the code.

    c) Compiling the code into an executable program

    d) Running the program to accomplish the task.

  3. Almost every C or C++ program you write will have one or more "header" files.

    A header effectively defines an "interface", usually to functionality provided by one or another "library".

    For example, header "stdio.h" is needed to use functions like "printf()" or "fopen()".

  4. You "#include" the header when you write your code (b); then the compiler reads the header when it compiles the program (c).

    The header is only important in steps b) and c).

    The only thing you do is "#include" the header in your source code.

    The compiler does the rest.

  5. You can read more about headers here:

http://www.tutorialspoint.com/cprogramming/c_header_files.htm

paulsm4
  • 114,292
  • 17
  • 138
  • 190