Hi everyone, i was hoping i could find some help here.
I am trying to get settings i have written into a textfile to be put in an array.
Here is what is in the txt file:

8
44100
1
2
1

I read the textfile with:

pStream = new FileStream(strSavePath, FileMode::Open);
pReader = new StreamReader(pStream);
count = 0;
for(;;)
{
count++
strLine = pReader->ReadLine();
Console::WriteLine(strLine);
if(strLine == 0)
break;
}

Now i want the strings i read from the txt file to be put into an array, with each new line being a new index of the array.
Thanks in advance.

Edited 3 Years Ago by happygeek: fixed formatting

Hi Greenthumb,

You can try this:

pStream = new FileStream(strSavePath, FileMode::Open);
pReader = new StreamReader(pStream);
count = 0;
int array[100];
for(;;)
{
    strLine = pReader->ReadLine();
    Console::WriteLine(strLine);
    if(strLine == 0)
        break;
    array[++count] = atoi(strLine);
}
This question has already been answered. Start a new discussion instead.