Object Array using Inheritance
You have to do it inside of function:

Sensor *sensors[2];

UltraSonicSensor uSensor;

void setup(){
  Serial.begin(9600);
  sensors[0] = &amp;uSensor;
}


Or directly:

UltraSonicSensor uSensor;

Sensor *sensors[] = {&amp;uSensor};


Don't forget to make method Sense() virtual in the base class and in the inherited classes. Otherwise you'll have to also find out the type of the object and typecast it to correct class pointer before it's use.

class Sensor
{
  public:
    virtual int Sense() = 0; // pure virtual base class
};

// and inherited class:

class UltraSonicSensor: public Sensor {
  public:
    // ...

    // Prototype must be exactly the same, by using override
    // is ensured it actually overrides something from the parent class. 
    virtual int Sense() override {
        // ...
    }
    // ...
}


Also the last versions of Arduino IDE supports C++11 standard so you can use range based for loop:

for (Sensor * sensor : sensors) {
    int val = sensor-&gt;Sense();
    // ...
}