C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void replaceAll(char *, const char*);
int main ()
{
char *hey = "hello mf im god here punk";
const char *nee = "god";
replaceAll(hey, nee);
printf("\n");
for (size_t i = 0; i < strlen(hey); i++) {
printf("%c", hey[i]);
}
printf("\n");
free((char*) hey);
free((char*) nee);
return 0;
}
void replaceAll(char *str, const char *old) {
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run