Or you may see this using the initilization list. Doing it in the body is assignment. Data members are initilized prior to the ctor's body; although not true for built in types as there is no guarantee it was initilized to anything. For non built in types the default ctor is called first if you do not do it yourself in the initilization list, then assignment occurs in the body.
Code:class SearchArea { public: int Fscore; //total value to asses select node or not int Gscore; //movement cost int Hscore; //heurestic int Walkstate; //is it valid terrain int Liststate; //is it available? on open or closed list int STnode; //is it a / the search start point int TGnode; //is it a / the search target point int Xcord; // map node X (across) location int Ycord; // map node Y (down) location SearchArea() : Fscore(0), GScore(0)....etc { } };



LinkBack URL
About LinkBacks




