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:
Is it valid? Any other idea will be appreciated.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. };
Thanks.




Reply With Quote