This is my code
char function(char *dst) { int i; char *arr; i = 0; while(dst[i] != '\0') { arr[i] = dst[i]; i++; } dst[i] != '\0' return(arr); } int main(void) { char a[] ="asdf" printf("%s", function(a); }
I want to copy *dst
to empty *arr
but my code didn't work. I can't understand. How can I copy array without inner function in C(ex_strcpy, memspy....) Thank you
没有评论:
发表评论