Skip to content

Instantly share code, notes, and snippets.

@bcho
Created November 6, 2012 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bcho/4023614 to your computer and use it in GitHub Desktop.
Save bcho/4023614 to your computer and use it in GitHub Desktop.
#include <stdio.h>
void func(char *s, char *t);
int main()
{
char s[] = "time", t[100];
func(s, t);
printf("%s", t);
return 0;
}
void func(char *s, char *t)
{
char *head;
head = t;
while ((*(t++) = *(s++)))
;
printf("%d", *t);
printf("%s\n", head);
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment