How do I call a function from an array of objects?

 
class Symbol_info {

public:
   void print() {
      Alert("Hello, World!");
   }

};

Symbol_info symbols[3];
symbols[0].print();
how do I call this print function from an array of objects? If I were to make an object and call this function from a singular object it would work fine, however I get an exception thrown If I'm using an array and I don't even get told the exception. Can someone help me with this problem?
 
qwerfd:
how do I call this print function from an array of objects? If I were to make an object and call this function from a singular object it would work fine, however I get an exception thrown If I'm using an array and I don't even get told the exception. Can someone help me with this problem?

dont call print() in the global scope 

 
Lorentzos Roussos:

dont call print() in the global scope 

I'm calling it in OnInit function. I just used this code as an example of my usage. 
 
qwerfd:
I'm calling it in OnInit function. I just used this code as an example of my usage. 

weird , what exception are you getting 

Reason: