I'm sorry if this is a dumb question, but I tried many different sources and I'm still not getting what I want. I'm working on a program that reads from a text file, and in the code below, I'm trying to read the first line that will give me the number of resistor color codes were created below it. I'm trying to read the number (n) and simply print it to see that it reads, but I get nothing. It seems so simple, but I can't seem to get it.
`FILE *fpinpt;
FILE *fpoutpt;
FILE *fpnom;
int n, *ptr;
double a, b, c, d, e, f, g, h, i, j, k, l;
fpinpt= fopen("F:\EGR 107\EE\HW 4\resistorInput.txt","r");
fpoutpt= fopen("F:\EGR 107\EE\HW 4\resistorOutput.txt","w");
fpnom= fopen("F:\EGR 107\EE\HW 4\resistorNominal.txt","w");
fscanf(fpinpt,"%d\n",n);
printf("%d",n);
ptr=(int*)calloc(n, sizeof(int));
if (fpinpt==NULL)
{
printf("Error reading resistor file\n");
fclose(fpinpt);
}
if (ptr==NULL) printf("Error, memory not allocated\n");
`