Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Copy(char* destination,const char* source)
- {
- char* p = destination;
- while(*source)
- {
- *p = *source;
- p++;
- source++;
- }
- p = '\0';
- }
- int main()
- {
- char str1[100];
- char str2[100];
- printf("Enter first string: ");
- gets(str1);
- Copy(str2, str1);
- printf("String 2: %s", str2);
- return 0;
- }
Add Comment
Please, Sign In to add comment