• [^] # Re: Petite erreur

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

    J'ai lu un peu vite.
    Comme dis plus haut , il faut que tu alloue de la mémoire pour test dans ton main :

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

    et écris ta fonction wasaa comme ca :

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