Skip to content

Instantly share code, notes, and snippets.

@TechZi
Created December 23, 2010 07:18
Show Gist options
  • Save TechZi/752688 to your computer and use it in GitHub Desktop.
Save TechZi/752688 to your computer and use it in GitHub Desktop.
copy string
#include <stdio.h>
void main()
{
char a[] = "i am a boy";
char b[20];
int i;
for (i = 0; *(a + i) != '\0'; i++)
{
*(b + i) = *(a + i);
}
*(b + i) = '\0';
printf("%s\n", b);
getchar();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment