Creating a header file

This is a discussion on Creating a header file within the C Programming forums, part of the General Programming Boards category; Hi, I am currently studying 'C' and I was just wondering how do I create user defined header files....

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    66

    Creating a header file

    Hi, I am currently studying 'C' and I was just wondering how do I create user defined header files.

  2. #2
    Registered User Dr. Bebop's Avatar
    Join Date
    Sep 2002
    Posts
    96
    Just create a file with a .h extension and throw declarations into it.
    Code:
    /* header.h */
    /* Inclusion guards to make sure the header
        is only included once. Any more is an error */
    #ifndef BIG_NASTY_MANGLED_NAME__H
    #define BIG_NASTY_MANGLED_NAME__H
    
    #define TRUE (1==1)
    #define FALSE !TRUE
    
    typedef int bool;
    
    void function();
    int another_function( int, float );
    
    #endif
    Processing error: Stupidity detected.
    ------------------------------
    Dr. Bebop
    Windows XP Professional Ed.
    Microsoft Visual Studio 6

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  2. Need help understanding Header Files
    By Kaidao in forum C++ Programming
    Replies: 11
    Last Post: 03-25-2008, 10:02 AM
  3. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  4. creating a header file problems
    By ssjnamek in forum C++ Programming
    Replies: 13
    Last Post: 12-03-2003, 10:29 AM

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