Hi, I am using root 3.05/05 I ran into trouble trying to push_back values in a stack. I do the following in root: .L FitRing.cxx++ .L FitRing.cxx main() The error is: Error: Can't call vector<double,allocator<double> >::push_back(param1) in current scope FILE:FitRing.cxx LINE:90 Possible candidates are... filename line:size busy function type and name (in vector<double,allocator<double> >) Error: non class,struct,union object $contain used with . or -> FILE:FitRing.cxx LINE:90 The code is as following: #include "TH2.h" #include "TFile.h" #include "TBenchmark.h" #include "TAxis.h" #include "TTree.h" #include "TF1.h" #include "TPaveLabel.h" #include "TCanvas.h" #include "TSystem.h" #include <iostream> #include <vector> void GetIt(std::vector<double> *contain); int main(){ std::vector<double> y; GetIt(&y); } void GetIt(std::vector<double> *contain) { .. double param1=0; ... param1=double(total->GetParameter(1)); if(param1!=0) contain->push_back(param1); ... } Thanks for the help
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET