doc_bean
04-07-2007, 19:03
Yep, another 'interesting' problem form me :laugh4:
I'm adapting someone else's code to fit my needs, now this person seems fond of using constructors like
State_Circle(const vector<double>& _pos ) {};
which uses two things I'm not used to (for the record, i started c++ less than half a year ago, cut me some slack ) which apparently means that instead of an actual vector an adress is given to the program and the const keeps you from changing the adress within the code of the program.
Is this explanation about right ? Any reason why the '&' is used to declare a pointer instead of '*' ? I couldn't find this particular structure back in any of the tutorials/manuals that I use.
Apparently segmentation errors are due to referring to faulty memory adresses, so I guess it has something to do with this structure (I also added log messages throughout the code and none of the ones in the class that should be called show up, so I'm assuming not even the constructor gets called).
I'm adapting someone else's code to fit my needs, now this person seems fond of using constructors like
State_Circle(const vector<double>& _pos ) {};
which uses two things I'm not used to (for the record, i started c++ less than half a year ago, cut me some slack ) which apparently means that instead of an actual vector an adress is given to the program and the const keeps you from changing the adress within the code of the program.
Is this explanation about right ? Any reason why the '&' is used to declare a pointer instead of '*' ? I couldn't find this particular structure back in any of the tutorials/manuals that I use.
Apparently segmentation errors are due to referring to faulty memory adresses, so I guess it has something to do with this structure (I also added log messages throughout the code and none of the ones in the class that should be called show up, so I'm assuming not even the constructor gets called).