Thread: if you want to edit program with me

  1. #1
    Join Date
    Apr 2004

    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
    * * * * * * * * * *
    #define n 10000  
    typedef struct  
    chariot matter [];  
    int note,coef;  
    typedef struct  
    tmatiere t[n];  
    / * 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
    The best I can figure is that you want to read from a file into a structure or list of structures?
    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:
    chariot matter [SIZE];
    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, 06:31 AM
  2. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  3. Replies: 3
    Last Post: 07-23-2005, 08:00 AM
  4. Extracting Data From Another Program
    By (TNT) in forum Windows Programming
    Replies: 3
    Last Post: 02-12-2002, 01:25 AM