hello everyone ..
im writting a C program that requires to insert
integers from a text file ..
the contents of the text file are:
1:2:4
4:12:5
13:7:5
1:20:4
how can i read each number and define it as an integer ????
please HELP !!
#include <stdio.h>
int main()
{
FILE *input;
input = fopen("input.txt", "r"); /* r for defining the mode r=read */
if (input==NULL)
{
printf("Cannot Open input.txt file !\n");
return 1;
}
else
{
printf("The File is Open n\n");
int i;
/* in here what should i do to read the file */
}
return 0;
}