I intended to initialize a pointer to an array of objects of the class 'Port.h'. To do so, first a pointer of type 'Port' is initialized, then the constructor of this class is called for every element of the array.
int main(){
Port *ports;
for (int m = 0; m < M; m++){
// Initialize
ports[m] = Port(***PARAMETERS***);
// ...
}
// ...
}
I am getting the following error when running the code:
error C4700: uninitialized local variable 'ports' used