Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. typedef struct studente {
  5.     char nome;
  6.     char cognome;
  7.     int eta;
  8. } stud;
  9.  
  10. struct impiegato
  11. {
  12.     char nome;
  13.     char cognome;
  14.     int eta;
  15. };
  16.  
  17. //stud diventa un nuovo tipo
  18. //nel main dichiaro stud
  19.  
  20. int main()
  21. {
  22.     struct impiegato imp;
  23.     imp.cognome='B';
  24.  
  25.     stud p1;
  26.  
  27.     p1.nome = 'A';
  28.  
  29.     printf("%c\n", p1.nome);
  30.     printf("\n");
  31.     printf("%c\n", imp.cognome);
  32.  
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement