I'm writing a program that keeps a text file which holds 10 lines. On each line will be a time, and a filename. The program will run in the background and at the specified time will play the sound file. I'm trying to load times from a text file into a variable. Here is my attempt, but nothing goes into the variable ×.
Code:
char* times[11];
void SetTimes()
{
int x=0;
for(x=0; x<=10; x++)
{
times[x] = "a";
}
}
void LoadTimes()
{
ifstream load;
load.open("times.txt");
//FILE* File;
//File = fopen("times.txt", "rb");
//if(File != NULL)
//MessageBox(NULL, "works", "test", MB_OK);
for(int x=0; x<=10; x++)
{
load>>times[x];
//fread(×, sizeof(char*[11]), 1, File);
}
//fclose(File);
load.close();
}
SetTimes works fine, of course, but not LoadTimes. After LoadTimes is run, the variable times is still empty.