-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtut29.c
More file actions
38 lines (29 loc) · 727 Bytes
/
tut29.c
File metadata and controls
38 lines (29 loc) · 727 Bytes
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
26
27
28
29
30
31
32
33
34
#include <stdio.h>
#include <string.h>
//Copyright Chelin Tutorials. All Rights Reserved
//http://chelintutorials.blogspot.com/
//Estructuras
struct alumno{
int nota;
char nombre[40];
int edad;
};//recuerden el ;
int main(void){
//crear variable a1 del tipo struct alumno
struct alumno a1;
//asigando la nota de a1
a1.nota=4;
//asignando la edad de a1
a1.edad=19;
//estamos asignando el nombre de a1
char nombre_aux[]="Javier Xavier";
strcpy(a1.nombre,nombre_aux);
//imprimo las cosaahh
printf("El alumno %s ,edad %d tiene nota %d\n",
a1.nombre,a1.edad,a1.nota);
//blah bla blah
struct alumno a7;
a1.nota=1;
a1.edad=2;
return 0;
}