Thread: it's a very long code "sorry"

  1. #1
    /*enjoy*/
    Join Date
    Apr 2004
    Posts
    159

    Exclamation it's a very long code "sorry"

    hello all hulls
    I want that to help me to you has compile the following code
    it is very long but there are only 4 errors help me has find them
    Code:
                    /****************************************************************/                
                    /*                                                              */  
                    /*  *********   **      **     *******     *********   **   **  */
                    /*  *********   ****    **     *******     *********    **  **  */
                    /*  **          ** **   **        **       **     **     ** **  */   
                    /*  **          **  **  **        **       **     **      ****  */ 
                    /*  *********   **  **  **        **       **     **       **   */
                    /*  *********   **  **  **        **       **     **       **   */ 
                    /*  **          **  **  **        **       **     **       **   */
                    /*  **          **  **  **     ** **       **     **       **   */
                    /*  **          **  ** **      ** **       **     **       **   */ 
                    /*  *********   **  ****       ** **       *********       **   */
                    /*  *********   **  ***        *****       *********       **   */
                    /*                                                              */  
                    /****************************************************************/ 
    
    
    
    
      /********************************************************************************************************/
      /*                             Programme Realiser par mr Saifeddine  Maatoug                            */
      /*   le 10/03/2004                                                                                      */ 
      /*                         Il s'agit d'un proget d'algorithmique dans l'ecole E.S.T.I                   */  
      /********************************************************************************************************/
    
    #include "stdio.h"
    
    #include "conio.h"
    
    #define n 100
    
    #define nb_max 12 
    
    typedef struct
    
    {
    
    	char name[20];
        
    	char prenom[20];
        
    	int  niveau;
    		
    	char sexe[1];
        
    	int  nb_m;
    	
    	int  cin;
    	
    	int  age;
    
    }etudianttype;
    
    typedef struct 
    
    {
    
    		char matiere[20];
    	
    	
    		float  note;
    	
    		int coef;
    
    }tmatiere;
    
    typedef struct
    
    {
    
    	tmatiere t[nb_max];
    
    }ttmatiere;
    
    /************************************************************************************************************/
    
    /************************************************************************************************************/
    
                                       
    
                                       /*******************************/
    
                                       /*   fonction moyenne eleve i  */    
    
                                       /*******************************/
    
    float moyenne(int m);
    
    {
    float r,sc,sm;
    
    	for(i=0;i<etudiant[m].nb_m;i++)
    	{
    		sm=((tttmatiere[m].t[i].note)*(tttmatiere[m].t[i].coef)) +sm;
    	    sc=tttmatiere[m].t[i].coef+sc;
    	}
    
    return(sm/sc);
    
    }  
                                           /* fin fonction moyenne */
    
                                    
    /***********************************************************************************************************/
                                       
                                       /*******************************/
                                       /* fonction classement eleve i */    
                                       /*******************************/
    
    
    int classement(int c);
    {
    int r=all;
    	for(i=0;i<all;i++)
    	{
    		if 	(moyenne(i)>moyenne(c))
    		{
    		r--;
    		}
    return(r);
    
    	}
                                           /* fin fonction classement */
    
    /***********************************************************************************************************/
                                
                                      /***********************************/
                                      /*     procedure clear screen     */
                                      /***********************************/ 
    
    void clrscr()
    {
    	int i,n=15;
    
    	for(i=0;i<n;i++)
    	{
    		printf("\n");
        	printf("\n");
    
    	}
    }                                  /* fin procedure clear screen */
    
    /***********************************************************************************************************/
    
    
                 /*************************************************************************************/
                 /*procedure annulation des chaines de caracters [(.) ==> est pris comme valeur nulle]*/
                 /*************************************************************************************/
    
    void vidage(int k)
    {
    	void main();
    	int c,u;
    
    etudiant[k].cin=0;
    etudiant[k].niveau=0;
    etudiant[k].sexe[1]='.';
    etudiant[k].nb_m=0;
    
    
    for(c=0;c<20;c++)
    	{
    		etudiant[k].name[c]='.';
    		etudiant[k].prenom[c]='.';
    }
    for(u=0;u<nb_max;u++)
    {		
    tttmatiere[k].t[u].matiere[u]='.';
    tttmatiere[k].t[u].note=0;
    tttmatiere[k].t[u].coef=0;
    		}
    	
    
    
    }
                                       /* fin procedure annulation */
    
    /************************************************************************************************************/
                               
                               /************************************************/
                               /* procedure affichage d'un etudiant par besoin */ 
                               /************************************************/
    
    void affichage(int i,int all)
    {
    	void main();
    	int j,c,k=0;
    /*affiche nom*/	
    
    	clrscr();
    	printf("\nNom: "); 
    for(c=0;c<20;c++)
    {
    	if (etudiant[i].name[c]=='.'){break;} // eof pour nom
    	printf("%c",(etudiant[i].name[c]));
    }
    /*affiche prénom*/
    printf("\nPrenom: "); 
    for(c=0;c<20;c++)
    {
    	if (etudiant[i].prenom[c]=='.'){break;} // eof pour prénom
    	printf("%c",(etudiant[i].prenom[c]));
    }
    /* affiche sexe*/
    printf("\nSexe: %c",etudiant[i].sexe[1]);//fin sexe
    /*affiche Numero carte identite */
    printf("\nNumeor carte identite: %i\n",etudiant[i].cin);// fin C.I.N
    /*affiche age*/
    printf("age :%i",etudiant[i].age);
    /* boucle matieres */
    printf("cette etudiant etuide %i matieres ",etudiant[i].nb_m); //combient de matiere etudie cette etudiant 
    for(c=0;c<nb_m;c++)
    if (k!=0)/*matiere afficheé donc on affiche note */{printf(": %0.3f\n",tttmatiere[i].note); // note de la matiere c apres affichage matiere 
    {
       for(j=0;j<20;j++)
       {
         k++; // valeur pour savoire es la matiere est afficheé
         if(tttmatiere[i].t[c].matiere[j]=='.'){break;} // eof pour nom matiere
    	 printf("%c",tttmatiere[i].t[c].matiere[j]);
       }
    
    }
    printf("\nMoyenne :%0.3f",moyenne(i));       
    printf("\nClassement : %i",classement(i)); 
    printf("pour revenir au menu principal appuiez (y)");if(getch()=='y'|'Y'){main();} // condition pour revenir au menu princiapl
    
    }
                                         /* fin procedure affichage*/
    
    /************************************************************************************************************/
    
    
                               /************************************************/
                               /*     Procedure saisie d'un nouveau etudiant   */
                               /************************************************/
    
    void saisie(int i,int all)
    
    {
    	void main();
    	vidage(i);
    	int c;
     /* saisie nom */
    	printf("\nDonnez Nom  --S.V.P--  --il faux ecrire 15 caracteres \npour les caracteres de plus vous pouvez les replacez par des points\n\01");
    	scanf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",&etudiant[i].name[0],&etudiant[i].name[1],&etudiant[i].name[2],&etudiant[i].name[3],&etudiant[i].name[4],&etudiant[i].name[5],&etudiant[i].name[6],&etudiant[i].name[7],&etudiant[i].name[8],&etudiant[i].name[9],&etudiant[i].name[10],&etudiant[i].name[11],&etudiant[i].name[12],&etudiant[i].name[13],&etudiant[i].name[14]); // saisie nom 
     /* fin saisie nom */
    	printf("\nDonnez Prenom --S.V.P--  --il faux ecrire 15 caracteres \npour les caracteres de plus vous pouvez les replacez par des points\n\01");
        scanf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",&etudiant[i].prenom[0],&etudiant[i].prenom[1],&etudiant[i].prenom[2],&etudiant[i].prenom[3],&etudiant[i].prenom[4],&etudiant[i].prenom[5],&etudiant[i].prenom[6],&etudiant[i].prenom[7],&etudiant[i].prenom[8],&etudiant[i].prenom[9],&etudiant[i].prenom[10],&etudiant[i].prenom[11],&etudiant[i].prenom[12],&etudiant[i].prenom[13],&etudiant[i].prenom[14]);// saisie prenom
     /* fin saisie prenom */	
        printf("\nDonnez N:C.I.N --S.V.P--\n\01"); 
    	scanf("%i",&etudiant[i].cin);          // saisie numero carte identite
    	while(etudiant.sexe[1]!='M'|'F')       // controle sexe etudiant(e)
    	{ 
    	printf("\nDonnez sexe (M/F)\n\01");   //saisie sexe etudiant(e)   
    		scanf("%c",&etudiant[i].sexe[1]);
    	}
    	printf("\nDonnez nombre de matiere etudieé par cette eleve\n\01"); //saisie nombre de matiere par etudiant
    	scanf("%i",&etudiant[i].nb_m);
    	for(c=0;c<etudiant[i].nb_m;c++)
    	{
    	printf("\nDonnez Nom matiere: %i --S.V.P-- --il faux ecrire 15 caracteres \npour les caracteres de plus vous pouvez les replacez par des points\n\01",c);
    	scanf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",&tttmatiere[i].t[c].matiere[0],&tttmatiere[i].t[c].matiere[1],&tttmatiere[i].t[c].matiere[2],&tttmatiere[i].t[c].matiere[3],&tttmatiere[i].t[c].matiere[4],&tttmatiere[i].t[c].matiere[5],&tttmatiere[i].t[c].matiere[6],&tttmatiere[i].t[c].matiere[7],&tttmatiere[i].t[c].matiere[8],&tttmatiere[i].t[c].matiere[9],&tttmatiere[i].t[c].matiere[10],&tttmatiere[i].t[c].matiere[11],&tttmatiere[i].t[c].matiere[12],&tttmatiere[i].t[c].matiere[13],&tttmatiere[i].t[c].matiere[14]); // saisie Nom matiere 
    	
    	while(tttmatiere[i].t[c].note<0)
    	{printf("\nDonnez ca note\n\01");scanf("%f",&tttmatiere[i].t[c].note);}  // saisie note matiere de l'etudiant (i) matiere (c)
    	while(tttmatiere[i].t[c].coef<0)
    	{printf("\nDonnez son coeficient\n\01");scanf("%i",&tttmatiere[i].t[c].coef);}  // saisie coef matiere (c) de l'etudiant (i) 
    
    	}
        while(etudiant[i].age<=0)
    	{
    	printf("\ndonnez age etudiant\n");
    	scanf("%i",&etudiant[i].age);
    	}
    	
    	while((c>2)||(c<=0))
    	{
    	printf("\n\tDonnez votre choix \n");
    	printf("1-nouveau eleve\n");
    	printf("2-revenir au menu principal\n")
        printf("\01");
    	scanf("%i",&c);
    	}
    	clrscr();
    	if(c==1){saisie(all);}
    	if(c==2){main();}
    }
                             
                                                /* fin procedure saisie */
    
    /***********************************************************************************************************/
    
    
                                         /**************************************/
                                         /*       procedure Recherche          */
                                         /**************************************/
    void recherche(int all)
    
    { 
    	void main();
    
    	char ch_nom[15],ch_prenom[15];
    	int c,chi,ch_cin;
    	
    clrscr(); // effacer l'ecran
    
    printf("\nDonnez votre choix S.V.P \n");
    printf("1-Nom\n");
    printf("2-Prenom\n");
    print("3-C.I.N\n");
     
    scanf("%i",&chi); //saisie de choix 1 . 2 . 3
     
    	  switch(chi) // selon choix faire
    	 {
    	  case 1: {  //debut choix 1
    
        printf("\nDonnez Nom a RECHERCHER --S.V.P--  --il faux ecrire 15 caracteres \npour les caracteres de plus vous pouvez les replacez par des points\n\01");
      	scanf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",&ch_name[0],&ch_name[1],&ch_name[2],&ch_name[3],&ch_name[4],&ch_name[5],&ch_name[6],&ch_name[7],&ch_name[8],&ch_name[9],&ch_name[10],&ch_name[11],&ch_name[12],&ch_name[13],&ch_name[14]); // saisie nom a rechercher
    for(chi=0;chi<all;chi++)
     {
    	 trc=0;
    	 for(c=0;c<15;c++) //boucle recherche nom
    	 {
    		 if (etudiant[chi].name[c]==ch_name[c]){trc++;} // boucle recherche caractere par caractere
    	 }
    	 if (trc==15){trc=chi;break;}
    	 else{trc=0;} 
    break; // pour le case 1 
    }
    			  }  //fin choix 1
    
    	  case 2: {	 //debut choix 2 
    		  
    		  printf("\nDonnez Prenom a RECHERCHER --S.V.P--  --il faux ecrire 15 caracteres \npour les caracteres de plus vous pouvez les replacez par des points\n\01");
      	scanf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",&ch_prenom[0],&ch_prenom[1],&ch_prenom[2],&ch_prenom[3],&ch_prenom[4],&ch_prenom[5],&ch_prenom[6],&ch_prenom[7],&ch_prenom[8],&ch_prenom[9],&ch_prenom[10],&ch_prenom[11],&ch_prenom[12],&ch_prenom[13],&ch_prenom[14]); // saisie prenom a rechercher
    for(chi=0;chi<all;chi++)
    {	 trc=0;
    	 for(c=0;c<15;c++) // boucle recherche prenom
    	 {
    		 if (etudiant[chi].prenom[c]==ch_prenom[c]){trc++;} //recherche caractere par caratere 
    	 }
    	 if (trc==15){trc=chi;break;}
    	 else{trc=0;} 
    break; // pour le case 2
    } 
    			  }  //fin choix 2
    	  
    	  case 3: { // choix 3
    		  printf("\nDonnez Numero C.I.N  a RECHERCHER \n");
    		  scanf("%i",&ch_cin); //saisie cin a rechercher 
    		  for(chi=0;chi<all;c++)
    		  {
    			  if(etudiant[c].cin==ch_cin){trc=c;break;}
    			  else {trc=0;}
    		  }
    break;// pour le case 3
    			  } // fin choix 3
    	  default:{printf("le choix n'est pas valide");getch();recherche(all);}break;
    	  }
    	  if (trc!=0)
    	  {  //condition pour un etudiant existant 
    		  printf("\n----Etudiant existant---\n ");
    		  printf("Entrez votre choix\n");
    		  printf("1-Continuer ou Retour au menu\n");
    		  printf("2-afficher Fiche Etudiant");
    		  printf("3-Rechercher un autre Etudiant\n");
    		  scanf("%i",&c);
    	  clrscr(); // effacer l'ecran 
    		  switch (c)
    	  {
    	  
    	  case 1:break;
    	  case 2: affichage(trc,all);break;  
    	  case 3:recherche(all);break; 
    	  
    		  
    	  }  
    	  }	  
    	  else {
    		  printf("\nje ne peux rien confirmer car \nl'eleve ne se trouve pas aparament dans la liste\n");
    		  printf("Entrez votre choix\n");
              printf("1-Retour au menu\n");
              printf("2-Rechercher un autre Etudiant\n");
              scanf("%i",&c);
    		  switch(c)
    {
    		  case 1:main();break;
    		  case 2:recherche(all);break;
    
    		  }
    	  }
    }
    
    
    
                                       /* fin procedure recherche */
    
    /************************************************************************************************************/
                     
                                      /**************************/
    		       	    			  /* procedure modification */
    			         			  /**************************/
    
    void modif(int md)
    {
    	
    	void main();
    	int c;
    	clrscr();
    	printf("\nEntrez votre choix\n");
    	printf("1-modifier Nom\n");
    	printf("2-modifier prenom\n");
    	printf("3-modifier C.I.N\n");
    	printf("4-modifier sexe\n");
    	printf("5-modifier niveau\n");
    	printf("6-modifier age\n");
    	scanf("%i",&c);
    	switch(c)
    	{
    	
    	case 1:{ // modifier nom
    
    	printf("\nDonnez le nouveau Nom --S.V.P--  --il faux ecrire 15 caracteres \npour les caracteres de plus vous pouvez les replacez par des points\n\01");
      	scanf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",&etudiant[md].name[0],&etudiant[md].name[1],&etudiant[md].name[2],&etudiant[md].name[3],&etudiant[md].name[4],&etudiant[md].name[5],&etudiant[md].name[6],&etudiant[md].name[7],&etudiant[md].name[8],&etudiant[md].name[9],&etudiant[md].name[10],&etudiant[md].name[11],&etudiant[md].name[12],&etudiant[md].name[13],&etudiant[md].name[14]); // saisie nom a rechercher
    
    	   }break;
    	
    	case 2:{ // modifier prenom
    
        printf("\nDonnez le nouveau Prenom --S.V.P--  --il faux ecrire 15 caracteres \npour les caracteres de plus vous pouvez les replacez par des points\n\01");
        scanf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",&etudmdant[md].prenom[0],&etudmdant[md].prenom[1],&etudmdant[md].prenom[2],&etudmdant[md].prenom[3],&etudmdant[md].prenom[4],&etudmdant[md].prenom[5],&etudmdant[md].prenom[6],&etudmdant[md].prenom[7],&etudmdant[md].prenom[8],&etudmdant[md].prenom[9],&etudmdant[md].prenom[10],&etudmdant[md].prenom[11],&etudmdant[md].prenom[12],&etudmdant[md].prenom[13],&etudmdant[md].prenom[14]);// samdsmde prenom
     
    	   }break;
    	
    	case 3:{ //modifier C.I.N
    
    		printf("\nDonnez nouveau numero C.I.N\n"); 
    		scanf("%i",&etudiant[md].cin);   
    		   }break;
    	
    	case 4:{ //modifier sexe
    		
    		printf("\nDonner nouveau sexe !!!!\n");
    		scanf("%c",&etudiant[md].sexe[1]);
    		
    		   }break;
    	
    	case 5:{ //modifier niveau
    		   while(etudiant[md].niveau<=0)
    		   {
    		   printf("\nDonnez nouvea niveau\n");
    		   scanf("%i",&etudiant[md].niveau);
    		   }
    		   }break;
    	
    	case 6:{ //modifier age 
    		while(etdiant[md].age)
    		{
    		   printf("\nDonnez nouveau age\n");
    		   scanf("%i",&etudiant[md].age);
    		} 
    		
    		   }break;
    	default: {printf("Modification n'est pas reussite");c=0;break;} //message de modification nulle 
    	}
    if(c!=0)printf("\nModificatin reussite .....\n"); //modification positive 
    	printf("\nDonnez votre choix --S.V.P--");
    	printf("\n1-refaire une autre modification");
    	printf("\n2-revenir au menu");
    	scanf("%i",&c);
    	switch(c)
    	{
    	case 1:modif(md);break;
    	case 2:main();break;
    	}
    }
                                        /* fin procedure modification */
    
    /************************************************************************************************************/
    
    /************************************************************************************************************/
    /*********************************************** Bienvenue **************************************************/
    /******************** Procedure principal de programme gestion de scolarite *********************************/
    /************************************************************************************************************/
    /************************************************************************************************************/
    
    void main()
    
    { 
    etudianttype etudiant[n];
    ttmatiere tttmatiere[n];
    int all=0,one=7;
    int trc=all;
    // debut bienvenue
    while (one!=0)
    {
    printf("\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1");
    
    printf("--------------------------------------------------------------------------------");
    
    printf("------------ Bienvenue sur le menu de gestion scolarite E.S.T.I ----------------");
    printf("--------------------------------------------------------------------------------");
    printf("\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1");
     
    // fin bienvenue
    printf("\nEntrez votre choix\n");
    printf("\1-1-Saisie d'un nouveau etudiant\n");
    printf("\1-2-Recherche d'un etudiant\n");
    printf("\1-3-Modification de parametres d'un etudiant\n");
    printf("\1-4-Afficher la fiche d'un etudiant\n");  
    printf("\1-5-Quitter\n");
    scanf("%i",&one);
    
    switch(one)
    
    {
    case 1:{
    	clrscr();
    	vidage(all); // vidage de la partie a saisir  pour avoir une saiie reussite et parfaite 
    	saisie(all);all++ // incrementation de nb total d'etudiant en supposant qu'il y a un nouveau elmen saisie  
       
    	   }break;
    case 2:{
    	clrscr();
    	recherche(); // recherche par parametres
    	   
    	   
    	   }break;
    case 3:{
    	clrscr();
    	printf("--------------------------------------------------------------------------------");
        printf("----------pour Modifier un element il faux le rechercher en premier lieu--------")
    	printf("--------------------------------------------------------------------------------\n");
      	recherche();
    	modif(trc);
    	   
    	   }break;
    case 4:{
        
    	clrscr();
    	printf("--------------------------------------------------------------------------------");
      	printf("----------pour AFFICHER un element il faux le rechercher en premier lieu--------")
    	printf("--------------------------------------------------------------------------------\n");
      	recherche();
    	affichage(trc);
    	   
    	   }break;
    case 5:{;}break;
    
    default:{printf("votre choix n'est pas valide ");getch();main();}break;
    }
    }
    printf("--------------------------------------------------------------------------------");
    printf("------------------------Merci d'avoir choisi notre programme--------------------");
    printf("--------------------------------------------------------------------------------\n");
    
    }


    my compiler is on ......
    errors are
    Code:
    
    --------------------Configuration: bjh - Win32 Debug--------------------
    Compiling...
    jnk.cpp
    c:\bjh\jnk.cpp(89) : error C2447: missing function header (old-style formal list?)
    c:\bjh\jnk.cpp(112) : error C2447: missing function header (old-style formal list?)
    c:\bjh\jnk.cpp(559) : fatal error C1004: unexpected end of file found
    Error executing cl.exe.
    
    jnk.obj - 3 error(s), 0 warning(s)
    
    Last edited by enjoy; 05-02-2004 at 02:22 PM. Reason: adding errors

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    1: #include "stdio.h"
    #include <stdio.h>

    2: void main()
    int main()

    What errors are you getting?
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    /*enjoy*/
    Join Date
    Apr 2004
    Posts
    159
    i'm using visual c++
    "stdio.h" equivalent <stdio.h>
    int main() == void main() == void main(void)

  4. #4
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    >"stdio.h" equivalent <stdio.h>
    Nope.

    >int main() == void main() == void main(void)
    int main() != void main() != void main(void)
    Search the fscking board.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  5. #5
    /*enjoy*/
    Join Date
    Apr 2004
    Posts
    159
    try to compile this program and see the errors
    please .....

  6. #6
    /*enjoy*/
    Join Date
    Apr 2004
    Posts
    159
    Code:
    try to compile my  code because my compiler is busy ... :d

  7. #7
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Here is the biggest problem:
    Code:
    float moyenne(int m);
    {
    float r,sc,sm;
    That semicolon should not be there.
    Also:
    Code:
    int classement(int c);
    {
    int r=all;
    Once you have fixed those, you need to fix these:
    Code:
    testbed3.c(67) : error C2065: 'i' : undeclared identifier
    testbed3.c(67) : error C2065: 'etudiant' : undeclared identifier
    testbed3.c(67) : error C2109: subscript requires array or pointer type
    testbed3.c(69) : error C2065: 'tttmatiere' : undeclared identifier
    testbed3.c(69) : error C2109: subscript requires array or pointer type
    testbed3.c(69) : error C2109: subscript requires array or pointer type
    testbed3.c(70) : error C2109: subscript requires array or pointer type
    testbed3.c(88) : error C2065: 'all' : undeclared identifier
    ...
    testbed3.c(294) : fatal error C1003: error count exceeds 100; stopping compilation

  8. #8
    /*enjoy*/
    Join Date
    Apr 2004
    Posts
    159
    Code:
    testbed3.c(67) : error C2065: 'i' : undeclared identifier
    [ b] i is declared in any function who is used ???[/b]
    testbed3.c(67) : error C2065: 'etudiant' : undeclared identifier
    etudiant is declared in the main function 
    testbed3.c(67) : error C2109: subscript requires array or pointer type
    ?????
    testbed3.c(69) : error C2065: 'tttmatiere' : undeclared identifier
    tttmatiere is declared in the main 
    testbed3.c(69) : error C2109: subscript requires array or pointer type
    testbed3.c(69) : error C2109: subscript requires array or pointer type
    testbed3.c(70) : error C2109: subscript requires array or pointer type
    ????????????!!!!!!
    testbed3.c(88) : error C2065: 'all' : undeclared identifier
    all is deeclared in the main
    ...
    Code:
    explain me please  these errors

  9. #9
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    'Undeclared Identifier' simply means that you have not declared that variable in that scope.

    >> etudiant is declared in the main function <<

    That means it is available in the main() function. It is not available in other functions unless you pass it to them or declare it at file scope.

  10. #10
    /*enjoy*/
    Join Date
    Apr 2004
    Posts
    159
    what's the file scope
    excuse me my english is not good i'm just a beginner in english

  11. #11
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Code:
    /* Declared outside a function. Has global scope. Visible in all
     * functions in the project. */
    int a; 
    
    /* Declared outside a function with static specifier. Has file scope.
     * Visible in all functions in this file only. */
    static int b;
    
    int main(void)
    {
        /* Declared inside a function. Has function scope. Only visible in this function. */
        int c; 
    
        return 0;
    }
    I don't mean to send you away or anything, but if you need help in French occasionally, you can also use Developpez.
    Last edited by anonytmouse; 05-02-2004 at 03:03 PM.

  12. #12
    /*enjoy*/
    Join Date
    Apr 2004
    Posts
    159
    thank you anonytmouse for your help
    Last edited by enjoy; 05-03-2004 at 08:15 AM. Reason: 's

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inserting a swf file in a windows application
    By face_master in forum Windows Programming
    Replies: 12
    Last Post: 05-03-2009, 11:29 AM
  2. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  3. Bad code in book?
    By Darklighter in forum C++ Programming
    Replies: 7
    Last Post: 09-30-2006, 11:57 AM
  4. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  5. Background-process app
    By philip in forum C++ Programming
    Replies: 14
    Last Post: 03-26-2002, 12:22 PM