MakeClass array error

ROOT Version: 6.18.00
Platform: UBUNTU 18.04.4


Good afternoon people!

I’m using a MakeClass to run a code that was bellow:

void doseTes::Loop()
{
//   In a ROOT session, you can do:
//      root> .L doseTes.C
//      root> doseTes t
//      root> t.GetEntry(12); // Fill t data members with entry number 12
//      root> t.Show();       // Show values of entry 12
//      root> t.Show(16);     // Read and show values of entry 16
//      root> t.Loop();       // Loop on all entries
//

//     This is the loop skeleton where:
//    jentry is the global entry number in the chain
//    ientry is the entry number in the current Tree
//  Note that the argument to GetEntry must be:
//    jentry for TChain::GetEntry
//    ientry for TTree::GetEntry and TBranch::GetEntry
//
//       To read only selected branches, Insert statements like:
// METHOD1:
//    fChain->SetBranchStatus("*",0);  // disable all branches
//    fChain->SetBranchStatus("branchname",1);  // activate branchname
// METHOD2: replace line
//    fChain->GetEntry(jentry);       //read all branches
//by  b_branchname->GetEntry(ientry); //read only this branch
   if (fChain == 0) return;

   int nbins = 2000;
   gStyle->SetOptStat(1111);
   gStyle->SetPalette(57);
   
   TCanvas *can = new TCanvas("can","can",900,700); // control
   TCanvas *can1 = new TCanvas("can1","can1",900,700); //Ag
   /*TCanvas *can2 = new TCanvas("can2","can2",900,700); //I
   TCanvas *can3 = new TCanvas("can3","can3",900,700); //air
   TCanvas *can4 = new TCanvas("can4","can4",900,700); //Ti
   TCanvas *can5 = new TCanvas("can5","can5",900,700); //world */
     can->SetFrameBorderMode(1);
     can->SetLeftMargin(0.01);

     can1->SetFrameBorderMode(1);
     can1->SetLeftMargin(0.01);
     
     /*can2->SetFrameBorderMode(1);
     can2->SetLeftMargin(0.01);
     
     can3->SetFrameBorderMode(1);
     can3->SetLeftMargin(0.01);
     
     can4->SetFrameBorderMode(1);
     can4->SetLeftMargin(0.01);

     can5->SetFrameBorderMode(1);
     can5->SetLeftMargin(0.01);//*/
   
   //bins more than 800 doesn't work to TH3F
   // can
   TH2F *ana= new TH2F("ana","ana", nbins, 0.0,0.0455, nbins, 0.0,23.0);
   TH2F *ana1 = new TH2F("ana1","ana1",nbins, 0.0,0.0455, nbins, 0.0,23.0);
   //can1
   TH2F *ana2 = new TH2F("ana2","ana2",nbins, 0.0,0.0455, nbins, 0.0,1850.0);
   TH2F *ana3 = new TH2F("ana3","ana3",nbins, 0.0,0.0455, nbins, 0.0,1850.0);
   
   // can1
   /*TH2F *ana4= new TH2F("ana4","ana4", nbins, 0.0,0.0455, nbins, 0.0,0.5);
   TH2F *ana5 = new TH2F("ana5","ana5",nbins, 0.0,0.0455, nbins, 0.0,0.5);
   TProfile2D *ana6 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);
   TProfile2D *ana7 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);//*/
   
   // can2
   /*TH2F *ana8= new TH2F("ana8","ana8", nbins, 0.0,0.0455, nbins, 0.0,0.5);
   TH2F *ana9 = new TH2F("ana9","ana9",nbins, 0.0,0.0455, nbins, 0.0,0.5);
   TProfile2D *ana10 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);
   TProfile2D *ana11 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);//*/
   
   // can3
   /*TH2F *ana12= new TH2F("ana12","ana12", nbins, 0.0,0.0455, nbins, 0.0,0.5);
   TH2F *ana13 = new TH2F("ana13","ana13",nbins, 0.0,0.0455, nbins, 0.0,0.5);
   TProfile2D *ana14 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);
   TProfile2D *ana15 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);//*/
   
   // can4
   /*TH2F *ana16= new TH2F("ana16","ana16", nbins, 0.0,0.0455, nbins, 0.0,0.45);
   TH2F *ana17 = new TH2F("ana17","ana17",nbins, 0.0,0.0455, nbins, 0.0,0.45);
   TProfile2D *ana18 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);
   TProfile2D *ana19 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);//*/
   
   // can5
   /*TH2F *ana20= new TH2F("ana20","ana20", nbins, 0.0,0.0455, nbins, 0.0,1850.0);
   TH2F *ana21 = new TH2F("ana21","ana21",nbins, 0.0,0.0455, nbins, 0.0,1850.0);
   TProfile2D *ana22 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);
   TProfile2D *ana23 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);//*/

can->Divide(2,2);
can1->Divide(2,2);
/*can2->Divide(2,2);
can3->Divide(2,2);
can4->Divide(2,2);
can5->Divide(2,2);//*/
   
can->cd(1);//*/
can1->cd(1);//*/
//can2->cd(1);//*/
//can3->cd(1);//*/
//can4->cd(1);//*/
//can5->cd(1);//*/

   Long64_t nentries = fChain->GetEntries(); //para 25000 event => 202287 steps, deu 209435 1997243

   for (Long64_t jentry=0; jentry<nentries;jentry++) {
      Long64_t ientry = LoadTree(jentry);
      if (ientry < 0) break;  
      nb = fChain->GetEntry(jentry);   nbytes += nb;
       // if (Cut(ientry) < 0) continue;
      
      cout<<"size total = " <<nentries<<endl;
      cout<<"entry = "<<jentry<<endl;
      cout<<endl;
      
      if(Step_FinalMaterial->size()>0){ mm++; // garantir que o size não é zero 
      
      Int_t cont=0; 
      while((cont<Step_FinalMaterial->size()-1)||(cont<Step_AccumulatedEnergyDeposited->size()-1)){cont++;}
      
        if(Step_AccumulatedEnergyDeposited->at(cont)>0.0){mm1++;
 
          if((Step_FinalMaterial->at(cont)=="G4_WATER")){mm2++;
          
                  if(Step_Particle->at(cont) == "gamma"){gg++;}
				else{
					if(Step_Particle->at(cont) == "e-"){ee++;}					
				}
          
                  for(Int_t l=0;l<Step_FinalMaterial->size();l++){mm8++;
                      if((Step_AccumulatedEnergyDeposited->at(l)>0)&&((TMath::Sqrt(pow(Step_FinalPosX->at(l),2)+pow(Step_FinalPosY->at(l),2)+pow(Step_FinalPosZ->at(l),2))>=0.40)&&((TMath::Sqrt(pow(Step_FinalPosX->at(l),2)+pow(Step_FinalPosY->at(l),2)+pow(Step_FinalPosZ->at(l),2)))<22.))){mm9++;
                     ekin = ekin + Step_FinalKineticEnergy->at(l);
                     edep = edep + Step_AccumulatedEnergyDeposited->at(l);
                     /*cout<<"edep = "<<Step_AccumulatedEnergyDeposited->at(l)<<endl;
                     cout<<"FinProc step = "<<Step_FinalProcess->at(cont)<<endl;
                     cout<<"CrProc step = "<<Step_CreatorProcess->at(cont)<<endl;
                     cout<<"sumDep step= "<<edep<<endl;//*/

                     ana->Fill(edep,TMath::Sqrt(pow(Step_FinalPosX->at(l),2)+pow(Step_FinalPosY->at(l),2)+pow(Step_FinalPosZ->at(l),2)));
                     
                     for (Int_t k=l+1; k < Step_FinalMaterial->size()-1; k++){ //216

				dist[count] = TMath::Sqrt((pow((Step_FinalPosX->at(k)-Step_FinalPosX->at(l)),2))+(pow((Step_FinalPosY->at(k)-Step_FinalPosY->at(l)),2))+(pow((Step_FinalPosZ->at(k)-Step_FinalPosZ->at(l)),2)));

					if (max < dist[count]){ //213
						max = dist[count];
					}

					count++;			
				     
				}//Elost->Fill(ener);//*/

				//cout<<" ener= "<<ener<<endl; //" edepE = "<<edepE<<" edepG = "<<edepG<<" edepTi = " << edepTi<<endl;

				//edE=edepE;
				//edG=edepG;

				//enE=enerE;
				//en=ener;
				//en=ener-edep;
				ed=edep;

				r = (max/2)*0.001;  //m
				/*rE = (maxE/2)*0.001;  //m
				rG = (maxG/2)*0.001;  //m //*/
						
				vol = (4*(TMath::Pi())*pow(r,3))/3; //m³
				/*volE = (4*(TMath::Pi())*(rE)**3)/3;//m³
				volG = (4*(TMath::Pi())*(rG)**3)/3; //m³*/

				mass = dens * vol; //Kg
				/*massE = dens * volE; //Kg
				massG = dens * volG; //Kg*/
				
				doseElost = (ed*1.6021773*pow(10,-13))/mass; //Gy
				//doseEdep = (ed*1.6021773*pow(10,-13))/mass; //Gy
				//if(edE==0){doseEdepE = (edE*1.6021773*pow(10,-13))/massE;}else{cout<<"0"<<endl;} //Gy
				/*doseEdepE = (edE*1.6021773*pow(10,-13))/massE;
				doseEdepG = (edG*1.6021773*pow(10,-13))/massG; //Gy
				//doseTi = (edTi*1.6021773*pow(10,-13))/mass;*/
                     }
                       
                  }
                 sumDep=edep;
                 edep=0;
                 somaTotal=somaTotal+sumDep;
                 somaTotal1=somaTotal;
                 
                 ana1->Fill(somaTotal,TMath::Sqrt(pow(Step_FinalPosX->at(cont),2)+pow(Step_FinalPosY->at(cont),2)+pow(Step_FinalPosZ->at(cont),2)));  
                 /*ana2->Fill(Step_FinalPosX->at(cont), Step_FinalPosZ->at(cont), Step_AccumulatedEnergyDeposited->at(cont));  
(Step_FinalProcess->at(cont)=="eIoni")&&(Step_CreatorProcess->at(cont)=="compt")&&
                 ana3->Fill(Step_FinalPosY->at(cont), Step_FinalPosZ->at(cont), Step_AccumulatedEnergyDeposited->at(cont));  //*/
                 
                 /*if(somaTotal==0.03549){mm23++;
                 cout<<"sumDep events= "<<sumDep<<endl;
                 cout<<"somaTotal events = "<<somaTotal<<endl;
                 cout<<"FinProc events = "<<Step_FinalProcess->at(cont)<<endl;
                 cout<<"CrProc events = "<<Step_CreatorProcess->at(cont)<<endl;
                 cout<<"+++"<<endl;
                 }//*/
                 
                somaTotal=0;
                 
          }
           else{
                  if((Step_FinalMaterial->at(cont)=="NIST_Air")||((TMath::Sqrt(pow(Step_FinalPosX->at(cont),2)+pow(Step_FinalPosY->at(cont),2)+pow(Step_FinalPosZ->at(cont),2))>=22.)&&((TMath::Sqrt(pow(Step_FinalPosX->at(cont),2)+pow(Step_FinalPosY->at(cont),2)+pow(Step_FinalPosZ->at(cont),2))<750.)))){mm7++;
                  
                  if(Step_Particle->at(cont) == "gamma"){gg1++;}
				else{
					if(Step_Particle->at(cont) == "e-"){ee1++;}					
				}

                  for(Int_t l=0;l<Step_FinalMaterial->size();l++){mm18++;
                      if((Step_AccumulatedEnergyDeposited->at(l)>0)&&((TMath::Sqrt(pow(Step_FinalPosX->at(l),2)+pow(Step_FinalPosY->at(l),2)+pow(Step_FinalPosZ->at(l),2))>=22.)&&((TMath::Sqrt(pow(Step_FinalPosX->at(l),2)+pow(Step_FinalPosY->at(l),2)+pow(Step_FinalPosZ->at(l),2))<1838)))){mm19++;
                     edepWor = edepWor + Step_AccumulatedEnergyDeposited->at(l);
                     ana2->Fill(edepWor,TMath::Sqrt(pow(Step_FinalPosX->at(l),2)+pow(Step_FinalPosY->at(l),2)+pow(Step_FinalPosZ->at(l),2)));
                     }
                  }
                 sumDepWor=edepWor;
                 
                 somaTotalWor=somaTotalWor+sumDepWor;
                 somaTotalWor1=somaTotalWor;
                 
                 
                 ana3->Fill(somaTotalWor,TMath::Sqrt(pow(Step_FinalPosX->at(cont),2)+pow(Step_FinalPosY->at(cont),2)+pow(Step_FinalPosZ->at(cont),2)));  
                 //((Step_FinalProcess->at(cont)=="msc")&&(Step_CreatorProcess->at(cont)=="phot")&&
                 /*ana6->Fill(Step_FinalPosX->at(cont), Step_FinalPosZ->at(cont), Step_AccumulatedEnergyDeposited->at(cont));  
                 ana7->Fill(Step_FinalPosY->at(cont), Step_FinalPosZ->at(cont), Step_AccumulatedEnergyDeposited->at(cont));  //*/
                 /*if((Step_FinalProcess->at(cont)=="eIoni")&&(Step_CreatorProcess->at(cont)=="compt")&&(somaTotalWor==0.03549)){mm23++;
                 cout<<"sumDepWor events= "<<sumDepWor<<endl;
                 cout<<"somaTotalWor events = "<<somaTotalWor<<endl;
                 cout<<"FinProcArWor events = "<<Step_FinalProcess->at(cont)<<endl;
                 cout<<"CrProcWor events = "<<Step_CreatorProcess->at(cont)<<endl;
                 
                 cout<<"««««««="<<endl;
                 }//*/
                 edepWor=0;
                 somaTotalWor=0;
                 
                  }else{if(Step_FinalLogicalVolume->at(cont)=="OutOfWorld"){mm20++;
                        for(Int_t l=0;l<Step_FinalMaterial->size();l++){mm21++;
                              if((Step_AccumulatedEnergyDeposited->at(l)>0)){mm22++;} 
                        }
                        }
                  }
                  
                  } sumDose = sumDose + dose;
            cout<<endl;
       } 
     }
  } cout<<endl;
   
   cout<< "number first if = "<<mm<<endl;
   cout<< "number of edep dif of zero = "<<mm1<<endl;
   cout<< "event control = "<<mm2<<endl;
      cout<< "step control = "<<mm8<<endl;
         cout<< "step control edep != 0 = "<<mm9<<endl;
   /*cout<< "event Ag = "<<mm3<<endl;
         cout<< "step Ag = "<<mm10<<endl;
         cout<< "step Ag edep != 0 = "<<mm11<<endl;
   cout<< "event iodine = "<<mm4<<endl;
         cout<< "step iodine = "<<mm12<<endl;
         cout<< "step iodine edep != 0 = "<<mm13<<endl;
   cout<< "event Air = "<<mm5<<endl;
         cout<< "step Air = "<<mm14<<endl;
         cout<< "step Air edep != 0 = "<<mm15<<endl;
   cout<< "event Ti = "<<mm6<<endl;
         cout<< "step Ti = "<<mm16<<endl;
         cout<< "step Ti edep != 0 = "<<mm17<<endl;//*/
   cout<< "event world = "<<mm7<<endl;
         cout<< "step world = "<<mm18<<endl;
         cout<< "step world edep != 0 = "<<mm19<<endl;
   cout<< "event OOW = "<<mm20<<endl;
         cout<< "step OOW = "<<mm21<<endl;
         cout<< "step OOW edep != 0 = "<<mm22<<endl;
         
   cout<< "gamma control = "<<gg<<endl;
   cout<< "e- control = "<<ee<<endl;
   cout<< "gamma world = "<<gg1<<endl;
   cout<< "e- world = "<<ee1<<endl;

An error was occur and I can’t how fix, could anyone help me?

Double_t dist=0;
Int_t count=0;

Message Error
In file included from input_line_8:1:
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:153:9: error: subscripted value is not an array, pointer, or vector
dist[count] = TMath::Sqrt((pow((Step_Fin…
^~
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:155:20: error: subscripted value is not an array, pointer, or vector
if (max < dist[count]){ //213
^~
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:156:17: error: subscripted value is not an array, pointer, or vector
max = dist[count];
^~
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:216:11: error: expected expression
else{
^
root [1] .L doseTes.C
In file included from input_line_33:1:
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:153:9: error: subscripted value is not an array, pointer, or vector
dist[count] = TMath::Sqrt((pow((Step_Fin…
^~
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:155:20: error: subscripted value is not an array, pointer, or vector
if (max < dist[count]){ //213
^~
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:156:17: error: subscripted value is not an array, pointer, or vector
max = dist[count];
^~

Thanks

Hi,
In your code you did not declare the array or vector dist. You need to do this, also count is not declared.

Lorenzo

Thanks @moneta for the answer.

Acttually I already declare these variables, but I don’t known if is right. So, I attached here the file doseTes.h for everyone see if was right!

Thanks again!
doseTes.h (14.4 KB)

You cannot declare it like this

It is an array, so do do:

std::vector<double > dist(n);

where n is the vector size, i…e the maximum value +1 reached by the variable count

Lorenzo

Thanks for the reply, @moneta!

I did what you said, but an error continues…

error

/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:153:17: error: no viable overloaded ‘=’
…dist[count] = TMath::Sqrt(pow((Step_FinalPosX->at(k)-Step_FinalPosX->at(l)),2)+(pow((Step_FinalPosY->at(k)-Step_FinalPosY->at(l)),2))+pow((Step_FinalPosZ->at(k)-Step_FinalPosZ->at(l)),2));
~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:447:7: note: candidate function not viable: no known conversion from ‘Double_t’
(aka ‘double’) to ‘const std::vector<double, std::allocator >’ for
1st argument
operator=(const vector& __x);
^
/usr/include/c++/7/bits/stl_vector.h:461:7: note: candidate function not viable: no known conversion from ‘Double_t’
(aka ‘double’) to ‘std::vector<double, std::allocator >’ for 1st
argument
operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
^
/usr/include/c++/7/bits/stl_vector.h:482:7: note: candidate function not viable: no known conversion from ‘Double_t’
(aka ‘double’) to ‘initializer_list<std::vector<double,
std::allocator >::value_type>’ (aka ‘initializer_list’)
for 1st argument
operator=(initializer_list<value_type> __l)
^
In file included from input_line_8:1:
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:155:14: error: invalid operands to binary expression (‘Double_t’ (aka ‘double’) and
‘vector<Double_t>’ (aka ‘vector’))
if (max < dist[count]){ //213
~~~ ^ ~~~~~~~~~~~
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:156:13: error: assigning to ‘Double_t’ (aka ‘double’) from incompatible type ‘vector<Double_t>’
(aka ‘vector’)
max = dist[count];

I place this values in declaration like you said, simply use Double_t in other to double, but even when I use double the error is the same:
std::vector<Double_t> dist[3424387];

Best regards!

It looks like the declaration is still not correct. .
It should be first of all
std::vector<Double_t> dist(3424387); and not std::vector<Double_t> dist[3424387];

These are basic C++ error. I think you find online many tutorials on how to use vectors or arrays in C++

Lorenzo

Thanks @moneta, I understand this! But the error persist also when I use this notation std::vector<Double_t>(3424387);

I place bellow the error message when I use this…

error

In file included from input_line_47:1:
In file included from /home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:2:
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.h:67:28: error: expected parameter declarator
std::vector<Double_t> dist(3424387);
^
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.h:67:28: error: expected ‘)’
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.h:67:27: note: to match this ‘(’
std::vector<Double_t> dist(3424387);
^
In file included from input_line_47:1:
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:153:10: error: too many arguments to function call, expected 0, have 1
dist(count) = TMath::Sqrt(pow((Step_Fina…
~~~~ ^~~~~
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.h:67:1: note: ‘dist’ declared here
std::vector<Double_t> dist(3424387);
^
In file included from input_line_47:1:
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:155:21: error: too many arguments to function call, expected 0, have 1
if (max < dist(count)){ //213
~~~~ ^~~~~
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.h:67:1: note: ‘dist’ declared here
std::vector<Double_t> dist(3424387);
^
In file included from input_line_47:1:
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:156:18: error: too many arguments to function call, expected 0, have 1
max = dist(count);
~~~~ ^~~~~
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.h:67:1: note: ‘dist’ declared here
std::vector<Double_t> dist(3424387);

error

In file included from input_line_47:1:
In file included from /home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:2:
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.h:67:28: error: expected parameter declarator
std::vector<Double_t> dist(3424387);
^
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.h:67:28: error: expected ‘)’
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.h:67:27: note: to match this ‘(’
std::vector<Double_t> dist(3424387);
^
In file included from input_line_47:1:
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:153:10: error: too many arguments to function call, expected 0, have 1
dist(count) = TMath::Sqrt(pow((Step_Fina…
~~~~ ^~~~~
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.h:67:1: note: ‘dist’ declared here
std::vector<Double_t> dist(3424387);
^
In file included from input_line_47:1:
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:155:21: error: too many arguments to function call, expected 0, have 1
if (max < dist(count)){ //213
~~~~ ^~~~~
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.h:67:1: note: ‘dist’ declared here
std::vector<Double_t> dist(3424387);
^
In file included from input_line_47:1:
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.C:156:18: error: too many arguments to function call, expected 0, have 1
max = dist(count);
~~~~ ^~~~~
/home/gamos/brachy_VMBox/Etapas/teste/sample/doseTes.h:67:1: note: ‘dist’ declared here
std::vector<Double_t> dist(3424387);
^

Thanks again!

Please upload your full file and all that is needed to compile and run. There are many other C++ errors

@moneta, Thank for the help!

I follow your suggestion and see some basic examples of array and just change the notation to:
Double_t dist[3424387]={};

This seems to work fine.

But I will upload the files to compile and run in the next message…

Thanks for the attention.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.