I want to create a series of 6 parallel arrays that are global variables to store file input, but I won't know how long they are meant to be until I've processed a part of the input. Is there a way to delay the initialization of an array until I've processed the length of the array?
It is possible to initialize a variable then give it a value later.
int[] myArray;
//... Do stuff.
myArray = new int[theLengthIWant];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.