scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

0030-memcpy.c (259B)


      1 #include <assert.h>
      2 #include <stdio.h>
      3 #include <string.h>
      4 
      5 /*
      6 output:
      7 testing
      8 done
      9 end:
     10 */
     11 
     12 int
     13 main()
     14 {
     15 	char buf[40];
     16 
     17 	puts("testing");
     18 	assert(!memcmp(memcpy(buf, "abc", 3), "abc", 3));
     19 	assert(memcpy(buf, "abc", 0) == buf);
     20 	puts("done");
     21 
     22 	return 0;
     23 }