Home

Hi! I've organized my code in different files - the declarations of
global variables and methods are contained in a file global.hh (for
compilation via makefile under Linux). In this file I included the
following:

extern const int dim; //dimension of the array

class Particle{
public:
double x[dim]; //particle position
};


Since dim is defined in another file (where main() is located), the code
does not compile. Does anyone have an idea how this could be fixed? I've
consulted several books, but this doesn't seem to be a common problem
(or I have the wrong books).

Thanks in advance for any advice!

Florian

previous
next

Re: How do we recognize veterans as veterans?
Re: Web based Reporting tool for Python
Re: Threaded Design Question
Re: Help with Dictionaries and Classes requested please.
Re: i am new to python-Please somebody help
Kidprotect
Fundacja Iskierka
Pajacyk
Fundacja Sloneczko
Podaruj Zycie