Hi guys, I’m trying to create a string array that I can use in a inheritable class…I get a syntax error.
Assets/Scripts/QnA.cs(5,26): error CS0650: Syntax error, bad array declarator. To declare a managed array the rank specifier precedes the variable’s identifier. To declare a fixed size buffer field, use the fixed keyword before the field type
using UnityEngine;
using System.Collections;
public class QnA : MonoBehaviour {
public string[,] myarray[] = new string[2, 5]()
{
myarray[0, 0] = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
myarray[0, 1] = "bb";
myarray[0, 2] = "cc";
myarray[0, 3] = "dd";
myarray[0, 4] = "ee";
myarray[1, 0] = "ff";
myarray[1, 1] = "gg";
myarray[1, 2] = "hh";
myarray[1, 3] = "ii";
myarray[1, 4] = "jj";
return myarray;
}
}