Hi all,
I just get stuck with this kind of simple problem. Such a novice i am.
Could you help me guys.:$
I try to built the code and for the first procedure i should open first the file. The file which i should opened its depend on the input i gave. Compiling it's OK. But It's not working. There no sign at all.
Here the code. (i am also attach kind of file i should open in this code)
#include <stdio.h>
#include <io.h>
#include <stdlib.h>
#include <string.h>
main()
{
FILE *finput, *fopen();
int i;
char pfile[80];
printf ("Type number of input (between 1 to 3): ");
scanf ("%i", i);
if (i = 1)
pfile == "pf1";
else if (i = 2)
pfile == "pf2";
else if (i = 3)
pfile == "pf3";
else
{printf ("Invalid Input, the number should between 1 to 3!!!");}
finput = fopen(pfile, "r");
if(finput==NULL) {printf("Error: can't open the file.txt\n");return 2;}
else {printf("File opened successfully.\n");}
fclose(finput);
system("pause");
return(0);
}
Thank you in advanced
inC