fellpz

Struct

Apr 6th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. struct tipo_endereco
  4. {
  5. char rua [50];
  6. int numero;
  7. char bairro [20];
  8. char cidade [30];
  9. char sigla_estado [3];
  10. long int CEP;
  11. };
  12. struct ficha_pessoal
  13. {
  14. char nome [50];
  15. long int telefone;
  16. struct tipo_endereco endereco;
  17. };
  18.  
  19. main (void)
  20. {
  21. struct ficha_pessoal ficha;
  22. strcpy (ficha.nome,"Luiz Osvaldo Silva");
  23. ficha.telefone=4921234;
  24. strcpy (ficha.endereco.rua,"Rua das Flores");
  25. ficha.endereco.numero=10;
  26. strcpy (ficha.endereco.bairro,"Cidade Velha");
  27. strcpy (ficha.endereco.cidade,"Belo Horizonte");
  28. strcpy (ficha.endereco.sigla_estado,"MG");
  29. ficha.endereco.CEP=31340230;
  30. return 0;
  31. }
Add Comment
Please, Sign In to add comment