I need to create a list of TLabel objects that can be accessed by all the methods of a project. Assuming the project is Project1, I put the line
TLabel * labeList[4];
at the top of the Unit1.cpp file, together with all the rest of my global variables that I declare there. With that line there, the project compiles and runs fine. But then, in one of my methods I put the line
labelList[0] = new TLabel (Owner);
and when I compile that I get the error message "Delphi style classes must be constructed using operator new."
So, I moved the declaration TLabel * labelList[4] into the method where labelList[0] is to be initialized. That solves the problem in that the project compiles and runs with no error message, but when in a separate method I put the line
labeList[0]->Visible = false;
I get the error message "Pointer to structure required on left side of -> or ->* " which I take it to mean that the second method doesn't "know" that labelList[0] is a structure. So, how do I make labelList public or global (I'm not sure which is the right term) while not getting the "Delphi style classes ..." error message?es
Thanks for any help, using C++.
River_Forest