Hi,
So, i am using a KeyValues file to read contents, and im saving what i get from KvGetSectionName (or KvGetString) to some global arrays, which will then be used in a loop to perform other actions.
However Im stuck with this for the arrays:
Code:
new String:g_SectionName[255]
char g_subSectionValues[255][255];
Here is the code that puts strings in arrays:
Code:
KvGetString(hKeyValues, NULL_STRING, g_subSectionValues[iSection][iSubsectionVal], sizeof(g_subSectionValues));
However when I try and echo/print a value from g_subSectionValues[0][0] (or any other location) it behaves weirdly. When I add another [255] it seems to behave correctly.
Code:
char g_subSectionValues[255][255][255];
However this makes the compiled plugin 10 times bigger (from ~8KB to ~200KB) and increases compilation time aswell.
I could decrease the first 2 dimension sizes, but I still feel like im doing this wrong.
Maybe there is a better way to do this, as I need sectionName to match with subSectionValues as they will be used kinda like identifiers.
And is there any difference between "char str[255]" and "new String:str[255]"?
Here is the cfg file im reading from.
Code:
"Names"
{
"Section1"
{
"a1_1" "Name 1_1"
"a1_2" "Name 1_2"
"a1_3" "Name 1_3"
}
"Section2"
{
"a2_1" "Name 2_1"
"a2_2" "Name 2_2"
}
}