Thread: functions and include

  1. #1
    lv.42 Berserker Drake's Avatar
    Join Date
    Jun 2005
    Posts
    67

    Exclamation functions and include

    I have 3 questions

    1. How do you include files from another file that have a function that you want to use?(ex: I create a menu() and I want to use the function in another code)

    2. What file would I need to include to use the sleep() function.

    3. Where would I go to find what functions operate under which files.


    thnx

    .

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    1)
    How do you include files from another file?
    You either have a file or you don't--there aren't files inside files. An #include statement causes the contents of the specified file to replace the include statement.

    2) Google or

    http://faq.cprogramming.com/cgi-bin/...&id=1043284392

    3) non-sensical
    Last edited by 7stud; 01-10-2006 at 07:54 PM.

  3. #3
    Registered User
    Join Date
    Aug 2002
    Location
    Hermosa Beach, CA
    Posts
    446
    What operating system?

    If unix, try the command "man sleep". Usually the man page tells you the header to include.

    If windows, the function is Sleep (capital s) or SleepEx. Go to help on the visual studio menu, then index, then type the function name. When you find the help topic, the header file is listed towards the bottom.

    To make your own include file, it's just a text file with a .h extension (and even that's not required). Mostly you put prototypes in the header file, but possibly also class definitions, structure definitions, or preprocessor macros (#define etc). lets say you make your header file funct.h. You would include it like this:

    Code:
    # include "funct.h"
    The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unkown Hang
    By Bladactania in forum C Programming
    Replies: 31
    Last Post: 04-22-2009, 09:33 AM
  2. 2d game
    By JordanCason in forum Game Programming
    Replies: 5
    Last Post: 12-08-2007, 10:08 PM
  3. Read and write hanging
    By zee in forum C Programming
    Replies: 8
    Last Post: 08-03-2004, 11:19 PM
  4. Dialog Will not appear?
    By curlious in forum Windows Programming
    Replies: 1
    Last Post: 10-20-2003, 10:32 AM
  5. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 04:25 AM