bhupixb

Struct Related

Sep 2nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. typedef struct s{
  5. char *a, *b;
  6. }st;
  7. int main(){
  8. st *x[10];
  9. for(int i = 0; i < 10; i++)
  10. x[i]->a = (char *) malloc(sizeof(char) * 10);
  11. scanf("%s", x[0]->a);
  12. printf("%s", x[0]->a);
  13.  
  14. return 0;
  15. }
Add Comment
Please, Sign In to add comment