Guest User

Untitled

a guest
Jun 24th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. char buffer[1024]
  2. char *p = buffer + 512;
  3.  
  4. char buffer[1024];
  5. char *p = &buffer[512];
  6.  
  7. char buffer[1024];
  8. strcpy(buffer, "hello ");
  9. strcpy(buffer + 6, "world!");
  10.  
  11. char buffer[1024];
  12. strcpy(buffer, "hello ");
  13. strcpy(&buffer[6], "world!");
  14.  
  15. char *my_strcpy(const char *s, char *t) {
  16. char *u = t;
  17. while (*t++ = *s++);
  18. return u;
  19. }
  20.  
  21. #include ctype.h
  22. void skip_spaces( const char **ppsz )
  23. {
  24. const char *psz = *ppsz;
  25. while( isspace(*psz) )
  26. psz++;
  27. *ppsz = psz;
  28. }
  29.  
  30. void fn(void)
  31. {
  32. char a[]=" Hello World!";
  33. const char *psz = a;
  34. skip_spaces( &psz );
  35. printf("n%s", psz);
  36. }
Add Comment
Please, Sign In to add comment