Working with headers.

So we are getting into setting up header files in class and our first project is to make a game that uses three files, the header, the main, and the other functions. I can't figure out how to get all of the files set up properly so that they will compile and run. This is what I have so far.


Header:
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef Header
#define Header
#include <iostream>

using namespace std;

void displayGame(int);
int generateNumber();
char generateOperand();
int readUserInput();
bool validateAnswer();

#endif 


Main:
1
2
3
4
5
6
#include "Header.h"

int main(){
	void displayGame(1);
	return(0);
}


Functions
1
2
3
4
5
#include "Header.h"

void displayGame(int num1){
	cout << num1;
}


All I'm trying to do right now is show an output to show me I've got the files working properly, then I will fill in the game, but so far it isn't working, the main function says I have an illegal use of 'void', what am I doing wrong?
Last edited on
Remove 'void' in main(). When calling a function, you just type the name + the parameters.
Holy shit I'm so dumb.
Topic archived. No new replies allowed.