Hello,
I'm trying to make a string lenghthier by 1 char using the following:
The output ofCode:void printChar(char* C){ int i=0; char ci = *(C+i); while (ci != '\0'){ printf(&ci); i++; ci = *(C+i); } } char* updateChar(char *C, char c){ int i=0; char ci = *(C+i); while (ci != '\0'){ i++; ci = *(C+i); } int j = i++; *(C+j) = (char*) malloc(sizeof(char*)); *(C + i) = c; *(C+(++i)) = '\0'; return C; }is: Wiao∞o !Code:char C[] = "Ciao"; *C = updateChar(C,'o'); printChar(C);