Printing an int array

In my game I want to have an n amount of text fields where the user can enter a number on each of them like so:

[29561-list+issues+2.png|29561]

But what I am getting inside each of the text field boxes is System.Int32[] instead of 0’s

[29564-list+issues+3.png|29564]

Here is the block of code that I am using:

String[] printlist = new String[tasks.Length];
				
for (var i = 0; i < printlist.Length; i++)
{
	printlist _= manager.RandomGestureSignSelector*;*_

_ int listvalue = new int*;*_

* SceneManager.DrawTextField(GUIRectWindow, new Rect(40, textFieldPosition_Y, 20, 20), ref listvalue, maxCharacters);
textFieldPosition_Y += 35;*

}
Can anyone help me figure out what it is that I am doing wrong? Many thanks in advance._

It looks like you haven’t initialised the printlist array

string[] printlist = new string[tasks.Length]{ "0", "0", "0", "0", "0", "0" };

OR

void Awake(){
  string[] printlist = new string[tasks.Length];
  for(int i = 0; i < printlist.Length; i++){
    printlist
  }
}

If you’re using GUI.TextField to display the value(s) you’ll not be able to pass the value using as an ref int as it will throw exceptions when non-numeric characters are input. First return it as a string then try to parse it as an int.

Also you’re creating a new array each iteration of printlist on line 4

string[] printList;
int[] listValue;

void Start(){
  printList = new string[6];
  listValue = new int[printList.Length];
  for(int i = 0; i < printList.Length; i++){
    printList *= "0";*

}
}

void OnGUI(){
printList[0] = GUI.TextField (new Rect(40, 40, 20, 20), printList[0]);
if(!int.TryParse (printList[0], out listValue[0])){
printList[0] = “0”;
listValue[0] = 0;
}
Obviously change the 0’s for ‘i’ and iterate through the list but try and get the basics working first.