TOPIC

Compilation error

Ana Cláudia asked 2 years ago

Pessoal me ajudem... por favor

Não consigo sair desse erro!

include include include

int valentina(const void m, const void n){ return (strcmp((char )m, (char )n)); }

int main(){ int valentina(const void m, const void n); char vi[21000000][21000000]; char its[21000000]; char *p; char comp[21000000][21000000]; int numerodelinhas; int l1=0; int l2=0; int i;

scanf("%d", &numerodelinhas); while(numerodelinhas--){ getchar(); scanf("%[^\n]", its); p = strtok(its, " ");

while(p!=NULL){ strcpy(vi[l1], p); l1++; p = strtok(NULL, " "); }

qsort((void*)vi, l1, sizeof(vi[0]), valentina); for(int i = 0; i < l1; i++){ if(!strcmp(vi[i], vi[i + 1]) == 0){ strcpy(comp[l2], vi[i]); l2++; } } printf("%s", comp[0]);

for(int i = 1; i < l2; i++){ printf(" %s", comp[i]); } printf("\n"); } return 0; }

Remember not post solutions. Your post may be reviewed by our moderators.

  • feodorv replied 2 years ago

    char vi[21000000][21000000]; 
    char comp[21000000][21000000];

    Are you sure that you have enough memory for such variables?