What to put in header files (.h)

This is a discussion on What to put in header files (.h) within the C Programming forums, part of the General Programming Boards category; hi I'm trying to organize a school project, and i would like to know if i can insert into header ...

  1. #1
    Registered User IndioDoido's Avatar
    Join Date
    Apr 2007
    Posts
    194

    What to put in header files (.h)

    hi

    I'm trying to organize a school project, and i would like to know if i can insert into header files the actual functions and structure code.

    Example:
    Code:
    //structure.h
    
    typedef struct data
    {
            int num;
            char name[50];
    }DATA;
    Code:
    //function.h
    
    void menu(*option, int number)
    {
            int i;
            for(i=0; i<number; i++)
            {
                    if(option != NULL)
                            printf("Example functon");
            }              
    }
    "Artificial Intelligence usually beats natural stupidity."

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Structures, yes, but your actual functions you want in a .c file.


    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 11-12-2008, 11:00 AM
  2. Header files in .h
    By swgh in forum C++ Programming
    Replies: 5
    Last Post: 05-29-2008, 09:58 AM
  3. about #include files and header files
    By bulletbutter in forum C++ Programming
    Replies: 9
    Last Post: 04-18-2008, 11:24 AM
  4. Difference between .h and .c files
    By Metalix in forum C Programming
    Replies: 9
    Last Post: 01-19-2005, 08:38 PM
  5. header .h files
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 09-03-2001, 10:26 PM

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