• [^] # Re: On progresse... mais c'est pas encore gagné...

    Posté par (site web personnel) . En réponse au message Structures.... Évalué à 2.

    chezmoicamarche.

    version de gcc ? chez moi 3.4.2

    void wazaa ( struct structure *sss )
    {
    sss->a = "aaa";
    sss->b = "bbb";
    sss->c = "ccc";
    }

    int main ( void )
    {

    struct structure *test;
    test = malloc ( sizeof ( struct structure ) );
    test->a = malloc ( 20 * sizeof ( char ) );
    test->b = malloc ( 20 * sizeof ( char ) );
    test->c = malloc ( 20 * sizeof ( char ) );

    test->a = "a non initialise";

    test->b = "b non initialise";

    test->c = "c non initialise";

    print_struct ( test );

    wazaa ( test );

    print_struct ( test );

    return ( 0 );

    }