Unable to create extern int in Header File

Hey everyone, this is my first time trying to use an extern int.
Anyways, I was wondering if someone could explain to me why it wouldn't work to include it in my header file (It worked in both CPPs).

1
2
3
4
5
6
7
8
9
10
11
12
13
// HEADER
#ifndef PA2_FUNCTIONS_H
#define PA2_FUNCTIONS_H

using namespace std;
#include <iostream>
#include <cmath>

extern const int ENTRIES = 10;

// some functions here

#endif 
You can't mark a variable extern and also give it a value - it's one or the other. The value has to be given in ONE source file.
Topic archived. No new replies allowed.