What does error conflicting types for '' mean?

后端 未结 4 518
逝去的感伤
逝去的感伤 2021-01-03 09:04

i got an error that said \"error: conflicting types for \'____\'. What does that mean?

4条回答
  •  一整个雨季
    2021-01-03 09:15

    it's probably because your function "_" already exists in your library. It happened to me with this function:

    I was using stdio.h

    int getline (char s[ ] , int lim) { int c, i;

    for (i=0; i < lim-1 && (c=getchar())!=EOF && c!='\n'; ++i)
        s[i] = c;
    if (c == '\n') {
        s[i] = c;
        ++i;
    }
    s[i] = '\0';
    return i;
    

    }

    When I changed "getline" to "getlinexxx" and gcc compiled it:

    int getlinexxx (char s[], int lim) { int c, i;

    for (i=0; i < lim-1 && (c=getchar())!=EOF && c!='\n'; ++i)
        s[i] = c;
    if (c == '\n') {
        s[i] = c;
        ++i;
    }
    s[i] = '\0';
    return i;
    

    }

    And the problem was gone

提交回复
热议问题