C/C++: Définition d’une structure en C

Author:


{filelink=13942}

#include 
#include 
//définition d'une structure
struct M_Structure {
  char nom[30];
  float val;
}  test;

main () {

	//Affecter des valeurs aux membres de la structure
    strcpy(test.nom, "Demo");
	test.val=1.2F;
    printf ("nom = %s ", test.nom);
    printf ("val = %f ", test.val);

	return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *