C/C++: Exemple d’initialisation des memebres d’une structure

Author:


{filelink=13955}

#include 

struct demo_struct
 {
  int ID;
  char nom[80];
  char prenom[80];
  long note;

} etudiant;

int main(void)
{
	//Initialiser tous les membres de la structure 'demo_struct'
	demo_struct initMembre={
		12,
		"Sakoba",
		"Adams",
		12};

 printf("Nom= %s, Prénom: %sn", initMembre.nom, initMembre.prenom);

 return 0;
}

Leave a Reply

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