So,i allocate some characters like these: scanf("%s",input); input = (char*)realloc(input,(n+1)*sizeof(char)); n++; i have tried doing free(input) but
scanf("%s",input); input = (char*)realloc(input,(n+1)*sizeof(char)); n++;