if you want to edit program with me

This is a discussion on if you want to edit program with me within the C Programming forums, part of the General Programming Boards category; hello all hulls. I want well that to help me to you has make this program I already have already ...

  1. #1
    /*enjoy*/
    Join Date
    Apr 2004
    Posts
    159

    Talking if you want to edit program with me

    hello all hulls.
    I want well that to help me to you has make this program
    I already have already a type of structure definite
    I want sauvgarder his/her/its contained in a file but toujour with the possibility to reread the
    parameters sauvgarder and to put back them of the same facont in their site before
    that them soivent sauvgarder...
    help me has make a program
    if his/her/its you gene you cannot write a function for the sauvgarde
    and another for reading and setting up
    already veils my structure definite
    * * * * * * * * * *
    Code:
     
    #define n 10000  
    typedef struct  
    {  
    chariot matter [];  
    int note,coef;  
    }tmatiere;  
    typedef struct  
    {  
    tmatiere t[n];  
    }ttmatiere;
    / * excuse me for mistakes of grammar or ortographes because I use a translator of language * /

    Code Tags added by Kermi3

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    The best I can figure is that you want to read from a file into a structure or list of structures?
    Code:
    int main( void )
    {
        ttmatiere something;
        FILE* fp;
        int count;
    
        fp = fopen( "yourfile.dat", "rb" );
        if( fp != NULL )
        {
            /*read from file*/
            for( count = 0; count < n; count++ )
                if( fread( &something[count], sizeof( tmatiere ), 1, fp ) != 1 )
                    break; /* read failed */
    
            fclose( fp );
        }
        return 0;
    }
    That's the best that I can figure from your post.

    Also, you need to give a size to your array:
    Code:
    chariot matter [SIZE];
    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. a phone book program
    By mackieinva in forum C Programming
    Replies: 2
    Last Post: 09-19-2007, 07:31 AM
  2. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 01:27 PM
  3. Replies: 3
    Last Post: 07-23-2005, 09:00 AM
  4. Extracting Data From Another Program
    By (TNT) in forum Windows Programming
    Replies: 3
    Last Post: 02-12-2002, 01:25 AM

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