I'm trying to make a program where a user inputs a string then if they want to enter a letter they want to replace and what with. I want to use malloc to set the array but how would I do it with scanf?
Please can someone help.
Thanks!
This is what the program looks before going to the replace method:
char *s,x,y;
printf("Please enter String \n");
scanf("%s ", malloc(s));
printf("Please enter the character you want to replace\n");
scanf("%c ", &x);
printf("Please enter replacment \n");
scanf("%c ", &y);
prinf("%s",s);
getline()(not part of the C99 Standard).