Advertisement
konalisp

Structs and Multiple Return

Feb 2nd, 2014
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdbool.h>
  4. #include <string.h>
  5.  
  6.  
  7. typedef struct{
  8.     int i1;
  9.     char *s1;
  10. } abe;
  11.  
  12. abe mre(int x, char *y);
  13.  
  14. int main(int argc, char **argv){
  15.     abe di = mre(12, "hello");
  16.    
  17.     printf("%s", di.s1);
  18.     return 0;
  19. }
  20.  
  21. abe mre(int x, char *y){
  22.     abe f;
  23.     f.i1 = x;
  24.     f.s1 = y;
  25.    
  26.     return f;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement