![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jul 2005
Posts: 12
Rep Power: 0
![]() |
beginner question here
like i said before, im very new to programming. im not sure what
#include <signal.h> #include <stdio.h> etc are. im not sure why i need those and im not sure what the header files are...some one help me plz ![]() |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
Headers provide the functions to use in your program. stdio.h is the header for the main functions like "printf()" (im assuming this is for C/C++). I'm not sure what signal.h has in store, but if you look in your compiler's directory, you'll find that header as a source file. You can look into it and check the notes for it's purpose as well as any other header.
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jul 2005
Posts: 12
Rep Power: 0
![]() |
ok thank u
|
|
|
|
|
|
#4 |
|
Newbie
Join Date: Jul 2005
Posts: 12
Rep Power: 0
![]() |
i've checked the directory and there's soo many h files...and im not sure which one to include.
|
|
|
|
|
|
#5 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Header files do not normally provide functions for use in your program. They provide declarations for functions which are in library files or in object files produced by other source files of your own. The "include" statement causes the file to be "copied and pasted" right into the source file at the point of inclusion. This is prior to the compile pass. The actual function is added at link time. Include files for library files are normally in a default location that the compiler knows about. Same with the library files. If they are not in those locations, you must specify at build time (either on the command line or with IDE settings) where the files are located. The format, "#include <somefile.h>" indicates that the file should be on that known "system path." The format, '#include "someotherfile.h"' (quotes instead of angle brackets) indicates that the file is on a secondary, local path, usually the same directory the source file is in. You may add path information to the include statement, such as "include <sys/somefile.h>". A complete build has a preprocessing step, where the include and other preprocessing directives, such as #define, are evaluated and become part of the source file. The source file is then compiled. If the compile is successful, the resulting object file may then be linked with other object files of your own, or with files from other libraries.
Look up any library functions you care to use -- the documentation will tell you the name of the header file to include.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|