swethareddy18 / Design-and-analysis-algorithm

0 stars 0 forks source link

Copy the contents of the string #19

Open swethareddy18 opened 2 years ago

swethareddy18 commented 2 years ago

include

include

include

char copyString(char s[]) { char s2; s2 = (char*)malloc(20);

strcpy(s2, s);
return (char*)s2;

} int main() { char s1[20] = "GeeksforGeeks"; char* s2; s2 = copyString(s1); printf("%s", s2); return 0; }