I finished a project and a got a 48/50 on it but the points I lost where due to it being one day late and not making a header file. So now I am going back and trying to make a header file (for self satisfaction) and my question is how do I make and complie a header file with the program.... here is what I tried:
I took the things my teacher wanted in the header, and placed them in a new file (hangman.h). This is what the file looks like:
I then placedCode:#include<stdio.h> #include<stdlib.h> #include<string.h> #include<ctype.h> void menu(int *option); void players(int *player); void playGame(char word, char list, int player, int count, char usedWord s); void getList(char word, char list, int *count); void getWord(char word, char list, char usedWords, int count); void enterWord(char word); void guessWord(char word); void drawMan(int numWrong); void listWrong(char wrongLetters, int i, char guess); void listText(char wrongLetters, int numWrong, char guess, char blanks);
at the begining of my hangman.c file.Code:#include<hangman.h>
I tried a few different complies but it didn't seem to work right.
So how should I complie it? And is there a way to complie the header once, so you don't have to recomplie it? (So if you wanted to reuse the header, no extra compile time).
(I believe my teacher said .:gcc project.c header.o -o project:. would add header.o to project.c and complie project.c. But how do you get header.h to header.o O o. Of course I could be a complete idiot and be way off... so if you aren't sure what I am talking about, but get the idea I don't either, let me know XD)
(I have a class in ten minutes, and then work till three or four. So if I don't reply right away, I apologize ^^; )