Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. 1 #include <string.h>
  2. 2 #include <stdio.h>
  3. 3 #include <stdlib.h>
  4. 4
  5. 5 int main()
  6. 6 {
  7. 7 char *buf = (char*)malloc(sizeof(char)*2000);
  8. 8 char tmp[256];
  9. 9 strcpy (tmp, "test");
  10. 10 printf ("tmp: %sn", tmp);
  11. 11 strncat (buf, tmp, strlen(tmp));
  12. 12 printf ("buf: %sn", buf);
  13. 13 }
  14.  
  15. tmp: test
  16. buf: test
  17.  
  18. 153 char *inbuf = (char*)malloc(sizeof(char)*2000);
  19. 154 char *outbuf = (char*)malloc(sizeof(char)*2000);
  20. 155 char *oldinbuf = (char*)malloc(sizeof(char)*2000);
  21. 156 char *errbuf = (char*)malloc(sizeof(char)*2000);
  22. 157 memset (inbuf, '', sizeof(inbuf));
  23. 158 memset (oldinbuf, '', sizeof(oldinbuf));
  24. 159 memset (errbuf, '', sizeof(oldinbuf));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement