I have created a .ini file that looks as follows:
[one]
heading=" available state";
name=['A', 'D', 'H'];
[two]
type= ["on", "off", "switch"];
The main C program to access this ini file looks like this:
#include <stdio.h>
#include <Windows.h>
int main ()
{
LPCSTR ini = "C:\coinfiguration.ini";
char returnValue1[100];
char returnValue2[100];
GetPrivateProfileString("states", "title", 0, returnValue1, 100, ini);
GetPrivateProfileString("reaction", "reac_type", 0, returnValue2, 100, ini);
printf(returnValue2[10]);
printf("%s \n" ,returnValue1);
printf(returnValue2);
return 0;
}
I am able to display the whole heading from setion one and also the whole array name. But instead of displaying the whole array (name) like this
['A', 'D', 'H'];
I just want to display the term 'A'. Similarly for the section two instead of this
["on", "off", "switch"];
I just want to diaply the "on". I cannot figure out a way to do this. Can somebody help me out please?