• [^] # Re: Type de compilation ?

    Posté par (site web personnel) . En réponse au message Différence affectation de structure et memcpy. Évalué à 2.

    C'est du C99.

    char *readline(const char *prompt)
    { 
     int i;
     int end = 0;
     int cur_col = 0;
     if (prompt) {
     printf("%s", prompt);
     cur_col = strlen(prompt);
     fflush(stdout);
     }
     struct winsize ws;
     ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws);
     int colonnes = ws.ws_col;
     struct termios oldt;
     tcgetattr(0, &oldt);
     //XXX: Cette ligne plante sous bochs... remplacée par un memcpy...
     //struct termios newt = oldt;
     struct termios newt;
     memcpy(&newt, &oldt, sizeof(newt));
     cfmakeraw(&newt);
     tcsetattr(0, TCSANOW, &newt);
    [...]