home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.disi.unige.it
/
2015-02-11.ftp.disi.unige.it.tar
/
ftp.disi.unige.it
/
pub
/
.person
/
CataniaB
/
teach-act
/
esempi
/
Strutture_Union
/
struct.c
next >
Wrap
C/C++ Source or Header
|
1997-04-06
|
518b
|
37 lines
#include <stdio.h>
struct punto
{
float x;
float y;
} Q;
struct punto P={0.0,0.0};
struct cerchio
{
struct punto Centro;
float Raggio;
} E;
struct cerchio C={{1.4,5.7},6}; /* inizializzazione complessa */
/* struct cerchio D={P,7}; Errore in compilazione! P non e' una costante */
main()
{
E.Centro=P;
/* oppure */
E.Centro.x=P.x;
E.Centro.y=P.y;
E.Raggio=0;
C=E;
printf("\n %f %f %f",E.Centro.x,E.Centro.y,E.Raggio);
}