Hi,

I am writing a simulation code. I have a class called "particle" which hold gas particles. Each gas particle has its neighbouring gas particles. And its neighbouring gas particles have their own neighbouring particles. I tried to write the "particle" class like below to hold neighbouring particles also:
Code:
class particle {
    int x;                 // particle location
    int y;
    int z; 

    particle *neighbour;      // I have taken one neighbour particle for simplicity to illustrate the problem.               
                              // Actually,  it is vector of particles.  
};
Is it valid? Any other idea will be appreciated.
Thanks.