jeudi 19 mars 2015

ns2 segmentation fault when calling a function from a different class


I am trying to make an algorithm work and it requires that i call a function from a class (resides in another file) in a different class, in order to perform a calculation.


In the .h file i did the following:



class PowerMonitor //outside the class
PowerMonitor *pwrm //in the public section of my class.


Then in the cc. file i do a



double capacity =0;
capacity = pwrm->get_capacity(); // which is a double


It compiles fine; however, i get a segmentation fault when running my tcl file. Note that if i delete the "capacity = pwrm->get_capacity();" line it works perfectly.




Aucun commentaire:

Enregistrer un commentaire