Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- char sz1[123] = "SONY",
- sz2[123] = " ONE, Two";
- //////////////////////////////////////////////////////
- void _strcpy(char *p1, char *p2)
- {
- int n = strlen(p2);
- for(int i = 0; i < n; i++)
- {
- sz1[i] = sz2[i];
- }
- sz1[n] = 0;
- }
- //////////////////////////////////////////////////////
- int main()
- {
- _strcpy(sz1, sz2);
- printf("%s \n", sz1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement