Quantcast
Channel: Go4Expert
Viewing all articles
Browse latest Browse all 1999

Reading Column in C

$
0
0
Code:
#include<stdio.h>
main()
{
    FILE *pToFile;
    int input[512],i,j,k,l;
    pToFile=fopen("data.txt","r");
    if (pToFile !=NULL)
    {
        fscanf(pToFile,"%d%d %d %d %d",input,&i,&j,&k,&l);
        printf("%d\n%d\n%d\n %d\n %d\n %d\n", input,i,j,k,l);
        fclose(pToFile);
    }
    else
    {
        printf("could not open the file \n");
    }
   return(0);
}
I was wondering why this code doesn't want to work??
and how to read a column in c programming

Viewing all articles
Browse latest Browse all 1999

Trending Articles