Hello,
I am reading values from an array and storing them in an init file using WritePrivateProfileString, all values are getting saved to file except for the value at the first index(0) of the array.However, when stepping through in debug the value is getting wrote to the file but once all values are wrote it is getting overwrote to "0" somehow. I have no clue on what is going on. Below is a sample of my code.
[code]
char final[4];
CString field = "";
for(int i = 0; i< 80; i++)
{
temp = table[i].num;
itoa(temp, final, 10);
field.Format("NPG_%d"), i);
WritePrivateProfileString(Section, field, final, PathName)
}
[code]
I don't see anythig wrong with the code I have. By any chance has anyone encountered this before. Any help/advice will be greatly appreciated.
And the problem is non-repro for me with this toy program (I replaced the MFC stuff with standard C). But I used my old Windows XP machine, so I suppose it just might be a new bug???