functions and include

This is a discussion on functions and include within the C++ Programming forums, part of the General Programming Boards category; I have 3 questions 1. How do you include files from another file that have a function that you want ...

  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,662
    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, 10: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-04-2004, 12:19 AM
  4. Dialog Will not appear?
    By curlious in forum Windows Programming
    Replies: 1
    Last Post: 10-20-2003, 11:32 AM
  5. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 05:25 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21