picoc/tests/21_char_array.c
zik.saleeba 755cbd30b5 Added new char array test
git-svn-id: http://picoc.googlecode.com/svn/trunk@266 21eae674-98b7-11dd-bd71-f92a316d2d60
2009-04-23 12:08:27 +00:00

25 lines
297 B
C

char *a = "hello";
printf("%s\n", a);
int c;
c = *a;
char *b;
for (b = a; *b != 0; b++)
printf("%c: %d\n", *b, *b);
char destarray[10];
char *dest;
char *src;
dest = &destarray[0];
src = a;
while (*src != 0)
*dest++ = *src++;
*dest = 0;
printf("copied string is %s\n", destarray);