I am trying to change a character of a char* passed into a function, but am either getting seg faults or the value of t in main is not updating. How can I update the value in main function?
#include <stdio.h>
int func (char r, char* i){
i = "hello";
char strclone[5];
strcpy(strclone, i);
strclone[0] = 'j';
i = &strclone;
}
int main() {
char* t;
func('0', t);
printf(t);
return 0;
}