can someone show me how I make this array on the heap a reference array so that all my function can use it. Bellow is my attempted but its not woking. Thanks for all the help!
1 2 3 4
//Arrays on the heap.
string* arrayNames = nullptr;
arrayNames = new string[students];
string& arrayNamesRef = arrayNamesRef;
You can't to that. The size of the array is part of the type and types are fixed at compile time so there is no way you can get a reference type to a dynamically allocated array because the size is decided at runtime.