Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 8th, 2005, 7:46 PM   #1
seymorebutts
Newbie
 
Join Date: Jul 2005
Posts: 12
Rep Power: 0 seymorebutts is on a distinguished road
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
seymorebutts is offline   Reply With Quote
Old Jul 8th, 2005, 8:58 PM   #2
Navid
Hobbyist Programmer
 
Navid's Avatar
 
Join Date: Feb 2005
Location: Canada
Posts: 187
Rep Power: 4 Navid is on a distinguished road
Send a message via MSN to Navid
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.
Navid is offline   Reply With Quote
Old Jul 8th, 2005, 9:04 PM   #3
seymorebutts
Newbie
 
Join Date: Jul 2005
Posts: 12
Rep Power: 0 seymorebutts is on a distinguished road
ok thank u
seymorebutts is offline   Reply With Quote
Old Jul 9th, 2005, 11:45 AM   #4
seymorebutts
Newbie
 
Join Date: Jul 2005
Posts: 12
Rep Power: 0 seymorebutts is on a distinguished road
i've checked the directory and there's soo many h files...and im not sure which one to include.
seymorebutts is offline   Reply With Quote
Old Jul 9th, 2005, 12:22 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:41 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC