Guest User

struct.c

a guest
Aug 15th, 2014
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.24 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int global = 42;
  4.  
  5. struct s_t
  6. {
  7.     long int a;
  8.     int* b;
  9. };
  10.  
  11. void foo(struct s_t s) {
  12.     printf("\ngreetings from foo!\n");
  13. }
  14.  
  15. int main() {
  16.     struct s_t s = { .a = 7L, .b = &global };
  17.  
  18.     foo(s);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment