Hi all,
I have a little problem using string and array of char.
I have a:
CString lit[10];
char mots[500];
Then I open a first file (txt), and get char per char until the program found a separator (like < and >) and it store the result in mots. If mots it is the good one, I copy the result in lit[j]; I search for 7 right word. After that I close the file, change the name, and open the next file the retrive the information I need. After opne a new file, I initialize the variables.
This work good with C++ with DEBUG configuration, but if I set to RELEASE configuration, it work a first time (for the first file) and the I have I proble of writing memory at the point
lit[j]=mots;
Have you a solution for this problem or an Idea or other ?
mots must be an array of char, because I use fgetc function and store the read charachter into mots, beginnig at index 0. A word find I initialize mots, before taking the follow word.
Many thank to all.
Best regards.
I have a little problem using string and array of char.
I have a:
CString lit[10];
char mots[500];
Then I open a first file (txt), and get char per char until the program found a separator (like < and >) and it store the result in mots. If mots it is the good one, I copy the result in lit[j]; I search for 7 right word. After that I close the file, change the name, and open the next file the retrive the information I need. After opne a new file, I initialize the variables.
This work good with C++ with DEBUG configuration, but if I set to RELEASE configuration, it work a first time (for the first file) and the I have I proble of writing memory at the point
lit[j]=mots;
Have you a solution for this problem or an Idea or other ?
mots must be an array of char, because I use fgetc function and store the read charachter into mots, beginnig at index 0. A word find I initialize mots, before taking the follow word.
Many thank to all.
Best regards.