Cannot use Array elements as part of commands

Hi, I am developing a project to read and compare the electricity consumption of 3 independent circuits.
I am using non invasive current sensors.
I have this prototype code to check what works and what does not.

I would like to be able not to have to use the same code over and over again so I built an array of sensors but it is not working as I may be missing something.

Thanks in advance
Paulo

// EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3

int SensorPins[] = {A0,A1,A2};
char *AreaLabes[] = {"Area00", "Area01", "Area02"};

#include "EmonLib.h"                   // Include Emon Library
//EnergyMonitor emon1;                   // Create an instance



int pino_sct = A1;

void setup()
{  

  for(int i=0; i<=sizeof(SensorPins); i++){
    EnergyMonitor *AreaLabes[i];                         <<PROBLEM
    *AreaLabes[i].current(SensorPins[i],60);          <<PROBLEM
  }
  
  Serial.begin(9600);
  //emon1.current(pino_sct, 50);             // Current: input pin, calibration.
}

void loop()
{
  double Irms = Area00.calcIrms(1480);  // Calculate Irms only
  Serial.print("Corrente: ");
  Irms = round(Irms);
  Serial.println(Irms);          // Irms
}

Objects do not have names at run time. They only have addresses. You can not do what you are trying to do, that way. You CAN create arrays, including arrays of objects.

Plus remember that if you create an object run-time it is subject to the rules of C++ scope.

if you want a friendly name for your instances, you could use pointers

EnergyMonitor AreaLabes[3];

EnergyMonitor* Area00 = &AreaLabes[0];  // EDITED to add address of operator!!
EnergyMonitor* Area01 = &AreaLabes[1];
EnergyMonitor* Area02 = &AreaLabes[2];

EnergyMonitor monitors[] = {Area00, Area01, Area02};

but then use dereferencing to iterate over the pointers

  for(int i=0; i<=sizeof(SensorPins); i++)
  {
    AreaLabes[i]->current(SensorPins[i], 60); <<PROBLEM SOLVED
  }
  // or
  Area00->someMemberFunction();

You have two arrays named AreaLabes. One is global, declared char * when it should be just char. The other is local to the setup() function, which is probably a mistake right there, but I cannot help with the declaration because I don't know what an EnergyMonitor is. Multiple uses of the same name are likely to get you into trouble.

Why you think that you can do Area00.calcIrms I don't know.

Hi, thanks.
I can´t say I understood it all but it will serve as basis for my research.
I will work with all the tips above to rebuild the prototype code above.
Regards
Paulo