C++ Class syntax question

Hi,

what does this code means Particle() : _framesLeft(0) {} ?

  
class Particle {  
public:  
    Particle() : _framesLeft(0) {}  
    //...  
  
private:          
    int  _framesLeft;  
  
};  

And how can it be translated into humble beginners code in a Particle.h and Particle.cpp style?

Cheers
rS

If you google “initialization lists c++” you can find some info, like:

http://www.cprogramming.com/tutorial/in-…-s-c++.html

the equivalent way to write that is:

  
Particle(){ frameLeft = 0;}  

hope that helps!
zach

And take a look here:
http://www.youtube.com/watch?v=ePHBxi73vw0

Emmanuel

Thanks a lot guys!

In many ways having some programming background like Actionscript and Processing is good to get started with OF but some times people like me come across those crazy syntax of C++ and we have no idea what is going on, this is brilliant! most of the time I feel like I am learning the roots of AS3 and P5

Cheers
rS