Videogioco

Creiamo un videogioco in console!

Download Slides in formato .pdf

Materiali


Il sorgente del codice mostrato nella slide numero 5.


Download del codice
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>

struct studente {
  char nome[40];
  char cognome[40];
  int eta;
  char classe[3];//"3B" "3C"
};

int main(){

  struct studente stud;
  
  printf("Inserire il nome dello studente: ");
  gets(stud.nome);
  printf("\nInserire il cognome dello studente: ");
  gets(stud.cognome);
  printf("\nInserire il età dello studente: ");
  scanf("%d",&stud.eta);
  printf("\nInserire la classe dello studente: ");
  scanf(" %s",stud.classe);
  
  printf("\nDati Immessi: %s - %s - %d -%s", stud.nome, stud.cognome, stud.eta, stud.classe);
  return 0; 
}

Linguaggio C