string copy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #include <stdio.h> #include <stdlib.h> char* String_Copy (char* destination, const char* source); int main (int argc, char** argv) { char* _String = (char*) calloc (30 + 1, sizeof (char)); String_Copy (_String, "Hello World!!"); printf ("%s\n", _String); free (_String); return 0; } char* String_Copy (char* destination, const char* source) { char* Return_Pointer = destination; while (*destination++ = *source++); return (char*) Return_Pointer; } | cs |
0 개의 댓글:
댓글 쓰기