typedef struct {
char *inputString;
int stringLenght;
} InputString;
string = (InputString *) malloc(NUMOFSTRING * sizeof(InputString));
string->inputString = (char *)malloc(STRINGLENGHT);
currentString = 1;
scanf("%c", &e);
while (e == ' ' || e == '\n') {
scanf("%c", &e);
}
while (!feof(stdin)) {
currentStringLenght = 1;
while (e != '\n' && e != ' ') {
string->inputString = &e;
currentStringLenght++;
if (currentStringLenght > STRINGLENGHT) {
string->inputString = (char*) realloc(string->inputString, currentStringLenght);
string->inputString = string->inputString + (currentStringLenght - 1);
} else {
string->inputString ++;
scanf("%c", &e);
}
}
what am i doing wrong? it puts the value of e in inputString correctly but then it doesn't change position so it keeps overwriting the letter