I put a conditional in to check the status of the "stress.txt" file being read, and turns out it isn't, like you said. But I updated the path, and it still isn't being read. Is there something incorrect about my syntax with "fopen" maybe?
Thanks again for the help, Tater. I appreciate it.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h> //not in use yet
int main(void)
{
if(fopen("c:\\stress.txt","r")==NULL) //conditional to check the status of the file
{
printf("Error reading file!");
getchar();
return 0;
}
else
{
FILE *stress_text=fopen("c:\\stress.txt","r");
int count_array_store; //control variable for the "for" loop below
int cat_1,cat_2,cat_3,cat_4,cat_5; //not in use yet
int a,b; //variables for storing array value per element
int location[998]; //array for integer number limited to three digits
double stress[998]; //array for floating point number limited to three whole number digits
for(count_array_store=0; count_array_store<=998; count_array_store++)
{
a=location[count_array_store];
b=stress[count_array_store];
fscanf(stress_text,"%i %lf\n",&a,&b); // I'm not sure if I need these newline characters,
printf("%i %lf \n",a,b); //but I wasn't really wanting to take any chances. I'm
} //somewhat shaky on my "fscanf" knowledge
fclose(stress_text);
getchar();
return 0;
}
}