Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. typedef unsigned long long ull_t;
  6. const ull_t SIZE = (1UL << 3);
  7.  
  8. typedef struct
  9. {
  10.     int foo;
  11.     int len;
  12.     int boo;
  13. } str_t;
  14.  
  15. int main()
  16. {
  17.     str_t *ptr = malloc(sizeof(str_t) * 2);
  18.     ptr[0].len = 10;
  19.     ptr[1].len = 22;
  20.    
  21.     ptr++;
  22.    
  23.     --ptr->len;
  24.    
  25.     printf("%i", ptr -> len);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement