I am trying to load a data file into my program.
fp = fopen("data.txt", "r");
//printf("\nfile check: %d", fp);
printf("Walmart/Sams' Club Stock Prices: ");
count = 0;
while (fscanf(fp, "%-1.2f", &data2[count]) != EOF)
{
printf("%f ", data2[count]);
{ count = count + 1; }
}
However, it can't find the file. Is there somewhere I have to put it for it to be read?