another header problem...

Okay, so I have a different problem this time. Now I'm trying to call essentially a random variable from a function in a header in order to determine the value of a variable in the main program. Looks like this
Main program:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include <ctime>
#include "randmon.h"

int main()
{
    using namespace std;
    int monster=monster_determine();
    switch (monster)
    {
           case 1:
                cout << "You must fight a boar!" << endl;
                break;
           case 2: 
                cout << "You must fight an Ogre!" << endl;
                break;
           case 3: 
                cout << "You must fight a tiger!"<<endl;
                break;
                           }
           cout << "Your use of header file seemed to work." << endl;
           
           system ("pause");
           return 0;
           
}


Header file randmon.h:
1
2
3
4
5
6
7
8
#ifndef MONSTER_H
#define MONSTER_H

int monster_determine(int)
{srand(time (NULL));
 return (rand()%3+1);
}


What I get is this compile error:
in file... (the header file)
unterminated #ifndef

the #ifndef and #define directives look just like the did in the previously mentioned add.h problem... so what is going on this time?

peace
Sorry, in header file fucntion is defined as
int monster_determine()

rather than int monster_determine(int)

the other gave more errors and I was trying to pare down errors to the fewest possible before continuing.

peace
Ah, solved it on my own, forgot #endif at the end of the header. *facepalm*
Topic archived. No new replies allowed.