Skip to content

Instantly share code, notes, and snippets.

@tera-ny
Created May 18, 2021 02:51
Show Gist options
  • Save tera-ny/ee60042a259497bd3ffee4ab6a27ef82 to your computer and use it in GitHub Desktop.
Save tera-ny/ee60042a259497bd3ffee4ab6a27ef82 to your computer and use it in GitHub Desktop.
#include <stdio.h>
char* my_strcpy(char* to, const char* from) {
size_t i;
for (i = 0; from[i] != '\0'; i++) {
to[i] = from[i];
}
to[i] = '\0';
return to;
}
int main() {
char a[20];
my_strcpy(a, "INIAD");
printf("%s\n",a);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment