View Single Post
r3D w0LF
Senior Member
Join Date: Dec 2013
Location: Albania
Old 09-16-2018 , 11:12   Re: Issue with multidimensional string arrays.
Reply With Quote #4

I don't think i got it. Here is a visualization of what i want/mean

Main section array:
Code:
array(2) {
  [0]=>
  string(8) "Section1"
  [1]=>
  string(8) "Section2"
}

Subsection array (which corresponds to main array):
Code:
array(2) {
  [0]=>
  array(3) {
    [0]=>
    string(5) "Name1_1"
    [1]=>
    string(5) "Name1_2"
    [2]=>
    string(5) "Name1_3"
  }
  [1]=>
  array(2) {
    [0]=>
    string(5) "Name2_1"
    [1]=>
    string(5) "Name2_2"
  }
}
By adding up, i think the issue is on the first main array, as I have declared it as g_SectionName[255]
Now that im having a cleaner look at the visualization i think it should be
g_SectionName[20][255] where 20 is max number of items in array and 255 max chars in each array item.
So the subarray ends up being g_subSectionName[20][10][255]

And, is there any difference between new String:str[x] or char str[x] ?

Last edited by r3D w0LF; 09-16-2018 at 11:12.
r3D w0LF is offline