Advertisement
Guest User

Untitled

a guest
Jan 12th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. MinhaEstrutura *
  2.  
  3. typedef MinhaEstrutura * pMinhaEstrutura;
  4.  
  5. #include <stdio.h>
  6.  
  7. typedef struct { int x; } MinhaEstrutura;
  8.  
  9. typedef MinhaEstrutura * MeuTipo;
  10.  
  11. int main(void) {
  12. MinhaEstrutura dado = { 1 };
  13. MeuTipo var = &dado; //teve que usar o operador para pegar o endereço
  14. printf("%d", var->x); //teve que usar -> para acessar o membro
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement