Please tell me...how to

This is a discussion on Please tell me...how to within the C Programming forums, part of the General Programming Boards category; get a program to read 3 sets of numbers in columns...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    19

    Please tell me...how to

    get a program to read 3 sets of numbers in columns

  2. #2
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,682
    well, if i understand you better, this might be the solution

    Code:
    void getnum(FILE *fp)
    {
            int temp[3];
        
        while(fscanf(fp,"%d %d %d",&temp[0],&temp[1],&temp[2])==3)
           printf("%d %d %d\n",temp[0],temp[1],temp[2]);
    
       return;
    }
    and this is not the complete programe. its up to you to write a main function for that

    ssharish2005
    Last edited by ssharish2005; 10-15-2005 at 10:13 PM.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21