begin process at 2012 05 29 16:06:51
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive C/C++

 > 

Archives

 > 

Au secours

 > 

pkoi c amarche pas !!!!!!!!!!!


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

pkoi c amarche pas !!!!!!!!!!!

mercredi 25 juin 2003 à 13:38:11 | pkoi c amarche pas !!!!!!!!!!!

zebrahead

j'ai un souci pkoi ca marche paaa,ouinnn, aider moi sivoupléééé,thanks a tous les mecs qui touchent tellement qui sauront trouver la finte,


#include<stdio.h>
#define TAILLE 20
typedef struct{
char nom [10];
char prenom [10];
char sexe;
float salaire[1000];
}t_personne;
t_personne fiche [TAILLE];

int nbfiches=-1;

/*effacer l'ecran*/
void e_effacer() {
system ("clear");
}

/*creer une entete*/
void e_entete (){
e_effacer();
printf("\n\t projetc");
pystem ("clear");
intf("\n\t faites vous plaisir");
}

/*menu principal*/
void e_principal(){
e_entete ();
printf ("\n\n\t 1 : ajouter une personne");
printf ("\n\n\t 2 : lister le personnel");
printf ("\n\n\t 3 : quitter");
printf ("\n\n\t\t\t Choix:");
}

/*fonction pour ajouter une personne*/
void ajouter_une_personne(){
e_entete();
printf("\n promo 20,vivi nous");
printf("\n AJOUTER UNE PERSONNE");
printf("\n NOM:");
scanf("%s",fiche [nbfiches+1].nom);
printf("\n PRENOM:");
scanf("%s",fiche [nbfiches+1].prenom);
printf("\n SEXE: m ou f");
scanf("%s",&fiche[nbfiches+1].sexe);
printf("\n SALAIRE:");
scanf("%f",&fiche[nbfiches+1].salaire);
nbfiches++;
}

/*fonction lister tout le personnel*/
void lister_tout_le_personnel(){
int i=0;
if (nbfiches >=0){
for(i=0;i<=nbfiches;i++){
printf("\n noms:");
printf("%s",fiche[i].nom);
printf("\n prenom:");
printf("%s",fiche[i].prenom);
printf("\n salaire:");
printf("%f",fiche[i].salaire);
getchar();
}}}

/*fonction lister toutes les femmes*/
void lister_toutes_les_femmes(){
int i,choix;
for(i=0;i<=nbfiches;i++){
if(fiche[i].sexe=='f'){
printf("vive nous");
printf("\n noms:");
printf("%s",fiche[i].nom);
printf("\n prenom:");
printf("%s",fiche[i].prenom);
printf("\n salaire:");
printf("%f",fiche[i].salaire);
getchar();
}}}

/*fonction lister tous les hommes*/
void lister_tous_les_hommes(){
int i,choix;
for(i=0;i<=nbfiches;i++){
if(fiche[i].sexe=='h'){
printf("vive nous");
printf("\n noms:");
printf("%s",fiche[i].nom);
printf("\n prenom:");
printf("%s",fiche[i].prenom);
printf("\n salaire:");
printf("%f",fiche[i].salaire);
getchar();
}}}

/*menu secondaire pour lister les gens*/
void e_secondaire(){
system ("clear");
int choix;
printf ("\n 1 : lister tout le personnel");
printf ("\n 2 : lister toutes les femmes");
printf ("\n 3 : lister tous les hommes");
printf ("\n 4 : retour au menu principal");
printf ("\n\n\t\t\t Choix : ");
do{
scanf("%d",&choix);
switch(choix){
case 1: lister_tout_le_personnel ();
case 2: lister_toutes_les_femmes ();
case 3: lister_tous_les_hommes ();
case 4: e_principal ();break;
}}
while(choix<1||choix>4);
}
int main(){
int choix;
do{
do{
e_principal ();
scanf("%d",&choix);
switch(choix){
case 1: ajouter_une_personne ();
break;
case 2: e_secondaire ();
break;

case 3: break;
}
}
while (choix<1||choix>3);
}
while (choix!=3);
}
mercredi 25 juin 2003 à 13:57:08 | Re : pkoi c amarche pas !!!!!!!!!!!

thebestvinz

Qu'est ce qui marche pas ds ton progµ?
Precision!
Veni Vidi Vici


-------------------------------
Réponse au message :
-------------------------------

> j'ai un souci pkoi ca marche paaa,ouinnn, aider moi sivoupléééé,thanks a tous les mecs qui touchent tellement qui sauront trouver la finte,
>
>
> #include<stdio.h>
> #define TAILLE 20
> typedef struct{
> char nom [10];
> char prenom [10];
> char sexe;
> float salaire[1000];
> }t_personne;
> t_personne fiche [TAILLE];
>
> int nbfiches=-1;
>
> /*effacer l'ecran*/
> void e_effacer() {
> system ("clear");
> }
>
> /*creer une entete*/
> void e_entete (){
> e_effacer();
> printf("\n\t projetc");
> pystem ("clear");
> intf("\n\t faites vous plaisir");
> }
>
> /*menu principal*/
> void e_principal(){
> e_entete ();
> printf ("\n\n\t 1 : ajouter une personne");
> printf ("\n\n\t 2 : lister le personnel");
> printf ("\n\n\t 3 : quitter");
> printf ("\n\n\t\t\t Choix:");
> }
>
> /*fonction pour ajouter une personne*/
> void ajouter_une_personne(){
> e_entete();
> printf("\n promo 20,vivi nous");
> printf("\n AJOUTER UNE PERSONNE");
> printf("\n NOM:");
> scanf("%s",fiche [nbfiches+1].nom);
> printf("\n PRENOM:");
> scanf("%s",fiche [nbfiches+1].prenom);
> printf("\n SEXE: m ou f");
> scanf("%s",&fiche[nbfiches+1].sexe);
> printf("\n SALAIRE:");
> scanf("%f",&fiche[nbfiches+1].salaire);
> nbfiches++;
> }
>
> /*fonction lister tout le personnel*/
> void lister_tout_le_personnel(){
> int i=0;
> if (nbfiches >=0){
> for(i=0;i<=nbfiches;i++){
> printf("\n noms:");
> printf("%s",fiche[i].nom);
> printf("\n prenom:");
> printf("%s",fiche[i].prenom);
> printf("\n salaire:");
> printf("%f",fiche[i].salaire);
> getchar();
> }}}
>
> /*fonction lister toutes les femmes*/
> void lister_toutes_les_femmes(){
> int i,choix;
> for(i=0;i<=nbfiches;i++){
> if(fiche[i].sexe=='f'){
> printf("vive nous");
> printf("\n noms:");
> printf("%s",fiche[i].nom);
> printf("\n prenom:");
> printf("%s",fiche[i].prenom);
> printf("\n salaire:");
> printf("%f",fiche[i].salaire);
> getchar();
> }}}
>
> /*fonction lister tous les hommes*/
> void lister_tous_les_hommes(){
> int i,choix;
> for(i=0;i<=nbfiches;i++){
> if(fiche[i].sexe=='h'){
> printf("vive nous");
> printf("\n noms:");
> printf("%s",fiche[i].nom);
> printf("\n prenom:");
> printf("%s",fiche[i].prenom);
> printf("\n salaire:");
> printf("%f",fiche[i].salaire);
> getchar();
> }}}
>
> /*menu secondaire pour lister les gens*/
> void e_secondaire(){
> system ("clear");
> int choix;
> printf ("\n 1 : lister tout le personnel");
> printf ("\n 2 : lister toutes les femmes");
> printf ("\n 3 : lister tous les hommes");
> printf ("\n 4 : retour au menu principal");
> printf ("\n\n\t\t\t Choix : ");
> do{
> scanf("%d",&choix);
> switch(choix){
> case 1: lister_tout_le_personnel ();
> case 2: lister_toutes_les_femmes ();
> case 3: lister_tous_les_hommes ();
> case 4: e_principal ();break;
> }}
> while(choix<1||choix>4);
> }
> int main(){
> int choix;
> do{
> do{
> e_principal ();
> scanf("%d",&choix);
> switch(choix){
> case 1: ajouter_une_personne ();
> break;
> case 2: e_secondaire ();
> break;
>
> case 3: break;
> }
> }
> while (choix<1||choix>3);
> }
> while (choix!=3);
> }
mercredi 25 juin 2003 à 14:02:23 | Re : pkoi c amarche pas !!!!!!!!!!!

BruNews

Administrateur CodeS-SourceS
et pourquoi:
float salaire[1000];
mille salaires par personne ???
BruNews, ciao...


-------------------------------
Réponse au message :
-------------------------------

> Qu'est ce qui marche pas ds ton progµ?
> Precision!
> Veni Vidi Vici
>
>
> -------------------------------
> Réponse au message :
> -------------------------------
>
> > j'ai un souci pkoi ca marche paaa,ouinnn, aider moi sivoupléééé,thanks a tous les mecs qui touchent tellement qui sauront trouver la finte,
> >
> >
> > #include<stdio.h>
> > #define TAILLE 20
> > typedef struct{
> > char nom [10];
> > char prenom [10];
> > char sexe;
> > float salaire[1000];
> > }t_personne;
> > t_personne fiche [TAILLE];
> >
> > int nbfiches=-1;
> >
> > /*effacer l'ecran*/
> > void e_effacer() {
> > system ("clear");
> > }
> >
> > /*creer une entete*/
> > void e_entete (){
> > e_effacer();
> > printf("\n\t projetc");
> > pystem ("clear");
> > intf("\n\t faites vous plaisir");
> > }
> >
> > /*menu principal*/
> > void e_principal(){
> > e_entete ();
> > printf ("\n\n\t 1 : ajouter une personne");
> > printf ("\n\n\t 2 : lister le personnel");
> > printf ("\n\n\t 3 : quitter");
> > printf ("\n\n\t\t\t Choix:");
> > }
> >
> > /*fonction pour ajouter une personne*/
> > void ajouter_une_personne(){
> > e_entete();
> > printf("\n promo 20,vivi nous");
> > printf("\n AJOUTER UNE PERSONNE");
> > printf("\n NOM:");
> > scanf("%s",fiche [nbfiches+1].nom);
> > printf("\n PRENOM:");
> > scanf("%s",fiche [nbfiches+1].prenom);
> > printf("\n SEXE: m ou f");
> > scanf("%s",&fiche[nbfiches+1].sexe);
> > printf("\n SALAIRE:");
> > scanf("%f",&fiche[nbfiches+1].salaire);
> > nbfiches++;
> > }
> >
> > /*fonction lister tout le personnel*/
> > void lister_tout_le_personnel(){
> > int i=0;
> > if (nbfiches >=0){
> > for(i=0;i<=nbfiches;i++){
> > printf("\n noms:");
> > printf("%s",fiche[i].nom);
> > printf("\n prenom:");
> > printf("%s",fiche[i].prenom);
> > printf("\n salaire:");
> > printf("%f",fiche[i].salaire);
> > getchar();
> > }}}
> >
> > /*fonction lister toutes les femmes*/
> > void lister_toutes_les_femmes(){
> > int i,choix;
> > for(i=0;i<=nbfiches;i++){
> > if(fiche[i].sexe=='f'){
> > printf("vive nous");
> > printf("\n noms:");
> > printf("%s",fiche[i].nom);
> > printf("\n prenom:");
> > printf("%s",fiche[i].prenom);
> > printf("\n salaire:");
> > printf("%f",fiche[i].salaire);
> > getchar();
> > }}}
> >
> > /*fonction lister tous les hommes*/
> > void lister_tous_les_hommes(){
> > int i,choix;
> > for(i=0;i<=nbfiches;i++){
> > if(fiche[i].sexe=='h'){
> > printf("vive nous");
> > printf("\n noms:");
> > printf("%s",fiche[i].nom);
> > printf("\n prenom:");
> > printf("%s",fiche[i].prenom);
> > printf("\n salaire:");
> > printf("%f",fiche[i].salaire);
> > getchar();
> > }}}
> >
> > /*menu secondaire pour lister les gens*/
> > void e_secondaire(){
> > system ("clear");
> > int choix;
> > printf ("\n 1 : lister tout le personnel");
> > printf ("\n 2 : lister toutes les femmes");
> > printf ("\n 3 : lister tous les hommes");
> > printf ("\n 4 : retour au menu principal");
> > printf ("\n\n\t\t\t Choix : ");
> > do{
> > scanf("%d",&choix);
> > switch(choix){
> > case 1: lister_tout_le_personnel ();
> > case 2: lister_toutes_les_femmes ();
> > case 3: lister_tous_les_hommes ();
> > case 4: e_principal ();break;
> > }}
> > while(choix<1||choix>4);
> > }
> > int main(){
> > int choix;
> > do{
> > do{
> > e_principal ();
> > scanf("%d",&choix);
> > switch(choix){
> > case 1: ajouter_une_personne ();
> > break;
> > case 2: e_secondaire ();
> > break;
> >
> > case 3: break;
> > }
> > }
> > while (choix<1||choix>3);
> > }
> > while (choix!=3);
> > }
>
mercredi 25 juin 2003 à 14:18:07 | Re : pkoi c amarche pas !!!!!!!!!!!

JediMaster

perso je connais pas system("clear"); tu est sur que ca existe
par contre je connais system("cls");
et aussi clrscr(); a utiliser avec conio.c(sur borland ou devC++) et econio.h(pour visualC++)

ton erreur vient peu etre de la?
sinon brusnew a raison utilise une variable float salaire; tout simplement sinon c'est 1000 salaire par personne et je pense pas que ca soit tres courant lol !

A++
-------------------------------
Réponse au message :
-------------------------------

> et pourquoi:
> float salaire[1000];
> mille salaires par personne ???
> BruNews, ciao...
>
>
> -------------------------------
> Réponse au message :
> -------------------------------
>
> > Qu'est ce qui marche pas ds ton progµ?
> > Precision!
> > Veni Vidi Vici
> >
> >
> > -------------------------------
> > Réponse au message :
> > -------------------------------
> >
> > > j'ai un souci pkoi ca marche paaa,ouinnn, aider moi sivoupléééé,thanks a tous les mecs qui touchent tellement qui sauront trouver la finte,
> > >
> > >
> > > #include<stdio.h>
> > > #define TAILLE 20
> > > typedef struct{
> > > char nom [10];
> > > char prenom [10];
> > > char sexe;
> > > float salaire[1000];
> > > }t_personne;
> > > t_personne fiche [TAILLE];
> > >
> > > int nbfiches=-1;
> > >
> > > /*effacer l'ecran*/
> > > void e_effacer() {
> > > system ("clear");
> > > }
> > >
> > > /*creer une entete*/
> > > void e_entete (){
> > > e_effacer();
> > > printf("\n\t projetc");
> > > pystem ("clear");
> > > intf("\n\t faites vous plaisir");
> > > }
> > >
> > > /*menu principal*/
> > > void e_principal(){
> > > e_entete ();
> > > printf ("\n\n\t 1 : ajouter une personne");
> > > printf ("\n\n\t 2 : lister le personnel");
> > > printf ("\n\n\t 3 : quitter");
> > > printf ("\n\n\t\t\t Choix:");
> > > }
> > >
> > > /*fonction pour ajouter une personne*/
> > > void ajouter_une_personne(){
> > > e_entete();
> > > printf("\n promo 20,vivi nous");
> > > printf("\n AJOUTER UNE PERSONNE");
> > > printf("\n NOM:");
> > > scanf("%s",fiche [nbfiches+1].nom);
> > > printf("\n PRENOM:");
> > > scanf("%s",fiche [nbfiches+1].prenom);
> > > printf("\n SEXE: m ou f");
> > > scanf("%s",&fiche[nbfiches+1].sexe);
> > > printf("\n SALAIRE:");
> > > scanf("%f",&fiche[nbfiches+1].salaire);
> > > nbfiches++;
> > > }
> > >
> > > /*fonction lister tout le personnel*/
> > > void lister_tout_le_personnel(){
> > > int i=0;
> > > if (nbfiches >=0){
> > > for(i=0;i<=nbfiches;i++){
> > > printf("\n noms:");
> > > printf("%s",fiche[i].nom);
> > > printf("\n prenom:");
> > > printf("%s",fiche[i].prenom);
> > > printf("\n salaire:");
> > > printf("%f",fiche[i].salaire);
> > > getchar();
> > > }}}
> > >
> > > /*fonction lister toutes les femmes*/
> > > void lister_toutes_les_femmes(){
> > > int i,choix;
> > > for(i=0;i<=nbfiches;i++){
> > > if(fiche[i].sexe=='f'){
> > > printf("vive nous");
> > > printf("\n noms:");
> > > printf("%s",fiche[i].nom);
> > > printf("\n prenom:");
> > > printf("%s",fiche[i].prenom);
> > > printf("\n salaire:");
> > > printf("%f",fiche[i].salaire);
> > > getchar();
> > > }}}
> > >
> > > /*fonction lister tous les hommes*/
> > > void lister_tous_les_hommes(){
> > > int i,choix;
> > > for(i=0;i<=nbfiches;i++){
> > > if(fiche[i].sexe=='h'){
> > > printf("vive nous");
> > > printf("\n noms:");
> > > printf("%s",fiche[i].nom);
> > > printf("\n prenom:");
> > > printf("%s",fiche[i].prenom);
> > > printf("\n salaire:");
> > > printf("%f",fiche[i].salaire);
> > > getchar();
> > > }}}
> > >
> > > /*menu secondaire pour lister les gens*/
> > > void e_secondaire(){
> > > system ("clear");
> > > int choix;
> > > printf ("\n 1 : lister tout le personnel");
> > > printf ("\n 2 : lister toutes les femmes");
> > > printf ("\n 3 : lister tous les hommes");
> > > printf ("\n 4 : retour au menu principal");
> > > printf ("\n\n\t\t\t Choix : ");
> > > do{
> > > scanf("%d",&choix);
> > > switch(choix){
> > > case 1: lister_tout_le_personnel ();
> > > case 2: lister_toutes_les_femmes ();
> > > case 3: lister_tous_les_hommes ();
> > > case 4: e_principal ();break;
> > > }}
> > > while(choix<1||choix>4);
> > > }
> > > int main(){
> > > int choix;
> > > do{
> > > do{
> > > e_principal ();
> > > scanf("%d",&choix);
> > > switch(choix){
> > > case 1: ajouter_une_personne ();
> > > break;
> > > case 2: e_secondaire ();
> > > break;
> > >
> > > case 3: break;
> > > }
> > > }
> > > while (choix<1||choix>3);
> > > }
> > > while (choix!=3);
> > > }
> >
>
mercredi 25 juin 2003 à 14:20:36 | Re : pkoi c amarche pas !!!!!!!!!!!

JediMaster

je regarde ton code si ta fait un copier, coller alors ya une faute de syntaxe =>pystem ("clear");
c'est quoi ton compilateur?
y corrige pas tes fautes??



-------------------------------
Réponse au message :
-------------------------------

> perso je connais pas system("clear"); tu est sur que ca existe
> par contre je connais system("cls");
> et aussi clrscr(); a utiliser avec conio.c(sur borland ou devC++) et econio.h(pour visualC++)
>
> ton erreur vient peu etre de la?
> sinon brusnew a raison utilise une variable float salaire; tout simplement sinon c'est 1000 salaire par personne et je pense pas que ca soit tres courant lol !
>
> A++
> -------------------------------
> Réponse au message :
> -------------------------------
>
> > et pourquoi:
> > float salaire[1000];
> > mille salaires par personne ???
> > BruNews, ciao...
> >
> >
> > -------------------------------
> > Réponse au message :
> > -------------------------------
> >
> > > Qu'est ce qui marche pas ds ton progµ?
> > > Precision!
> > > Veni Vidi Vici
> > >
> > >
> > > -------------------------------
> > > Réponse au message :
> > > -------------------------------
> > >
> > > > j'ai un souci pkoi ca marche paaa,ouinnn, aider moi sivoupléééé,thanks a tous les mecs qui touchent tellement qui sauront trouver la finte,
> > > >
> > > >
> > > > #include<stdio.h>
> > > > #define TAILLE 20
> > > > typedef struct{
> > > > char nom [10];
> > > > char prenom [10];
> > > > char sexe;
> > > > float salaire[1000];
> > > > }t_personne;
> > > > t_personne fiche [TAILLE];
> > > >
> > > > int nbfiches=-1;
> > > >
> > > > /*effacer l'ecran*/
> > > > void e_effacer() {
> > > > system ("clear");
> > > > }
> > > >
> > > > /*creer une entete*/
> > > > void e_entete (){
> > > > e_effacer();
> > > > printf("\n\t projetc");
> > > > pystem ("clear");
> > > > intf("\n\t faites vous plaisir");
> > > > }
> > > >
> > > > /*menu principal*/
> > > > void e_principal(){
> > > > e_entete ();
> > > > printf ("\n\n\t 1 : ajouter une personne");
> > > > printf ("\n\n\t 2 : lister le personnel");
> > > > printf ("\n\n\t 3 : quitter");
> > > > printf ("\n\n\t\t\t Choix:");
> > > > }
> > > >
> > > > /*fonction pour ajouter une personne*/
> > > > void ajouter_une_personne(){
> > > > e_entete();
> > > > printf("\n promo 20,vivi nous");
> > > > printf("\n AJOUTER UNE PERSONNE");
> > > > printf("\n NOM:");
> > > > scanf("%s",fiche [nbfiches+1].nom);
> > > > printf("\n PRENOM:");
> > > > scanf("%s",fiche [nbfiches+1].prenom);
> > > > printf("\n SEXE: m ou f");
> > > > scanf("%s",&fiche[nbfiches+1].sexe);
> > > > printf("\n SALAIRE:");
> > > > scanf("%f",&fiche[nbfiches+1].salaire);
> > > > nbfiches++;
> > > > }
> > > >
> > > > /*fonction lister tout le personnel*/
> > > > void lister_tout_le_personnel(){
> > > > int i=0;
> > > > if (nbfiches >=0){
> > > > for(i=0;i<=nbfiches;i++){
> > > > printf("\n noms:");
> > > > printf("%s",fiche[i].nom);
> > > > printf("\n prenom:");
> > > > printf("%s",fiche[i].prenom);
> > > > printf("\n salaire:");
> > > > printf("%f",fiche[i].salaire);
> > > > getchar();
> > > > }}}
> > > >
> > > > /*fonction lister toutes les femmes*/
> > > > void lister_toutes_les_femmes(){
> > > > int i,choix;
> > > > for(i=0;i<=nbfiches;i++){
> > > > if(fiche[i].sexe=='f'){
> > > > printf("vive nous");
> > > > printf("\n noms:");
> > > > printf("%s",fiche[i].nom);
> > > > printf("\n prenom:");
> > > > printf("%s",fiche[i].prenom);
> > > > printf("\n salaire:");
> > > > printf("%f",fiche[i].salaire);
> > > > getchar();
> > > > }}}
> > > >
> > > > /*fonction lister tous les hommes*/
> > > > void lister_tous_les_hommes(){
> > > > int i,choix;
> > > > for(i=0;i<=nbfiches;i++){
> > > > if(fiche[i].sexe=='h'){
> > > > printf("vive nous");
> > > > printf("\n noms:");
> > > > printf("%s",fiche[i].nom);
> > > > printf("\n prenom:");
> > > > printf("%s",fiche[i].prenom);
> > > > printf("\n salaire:");
> > > > printf("%f",fiche[i].salaire);
> > > > getchar();
> > > > }}}
> > > >
> > > > /*menu secondaire pour lister les gens*/
> > > > void e_secondaire(){
> > > > system ("clear");
> > > > int choix;
> > > > printf ("\n 1 : lister tout le personnel");
> > > > printf ("\n 2 : lister toutes les femmes");
> > > > printf ("\n 3 : lister tous les hommes");
> > > > printf ("\n 4 : retour au menu principal");
> > > > printf ("\n\n\t\t\t Choix : ");
> > > > do{
> > > > scanf("%d",&choix);
> > > > switch(choix){
> > > > case 1: lister_tout_le_personnel ();
> > > > case 2: lister_toutes_les_femmes ();
> > > > case 3: lister_tous_les_hommes ();
> > > > case 4: e_principal ();break;
> > > > }}
> > > > while(choix<1||choix>4);
> > > > }
> > > > int main(){
> > > > int choix;
> > > > do{
> > > > do{
> > > > e_principal ();
> > > > scanf("%d",&choix);
> > > > switch(choix){
> > > > case 1: ajouter_une_personne ();
> > > > break;
> > > > case 2: e_secondaire ();
> > > > break;
> > > >
> > > > case 3: break;
> > > > }
> > > > }
> > > > while (choix<1||choix>3);
> > > > }
> > > > while (choix!=3);
> > > > }
> > >
> >
>
mercredi 25 juin 2003 à 15:59:09 | Re : pkoi c amarche pas !!!!!!!!!!!

thebestvinz

system("clear") --> Compilateur gcc (Linux) pystem syntax error
Veni Vidi Vici


-------------------------------
Réponse au message :
-------------------------------

> je regarde ton code si ta fait un copier, coller alors ya une faute de syntaxe =>pystem ("clear");
> c'est quoi ton compilateur?
> y corrige pas tes fautes??
>
>
>
> -------------------------------
> Réponse au message :
> -------------------------------
>
> > perso je connais pas system("clear"); tu est sur que ca existe
> > par contre je connais system("cls");
> > et aussi clrscr(); a utiliser avec conio.c(sur borland ou devC++) et econio.h(pour visualC++)
> >
> > ton erreur vient peu etre de la?
> > sinon brusnew a raison utilise une variable float salaire; tout simplement sinon c'est 1000 salaire par personne et je pense pas que ca soit tres courant lol !
> >
> > A++
> > -------------------------------
> > Réponse au message :
> > -------------------------------
> >
> > > et pourquoi:
> > > float salaire[1000];
> > > mille salaires par personne ???
> > > BruNews, ciao...
> > >
> > >
> > > -------------------------------
> > > Réponse au message :
> > > -------------------------------
> > >
> > > > Qu'est ce qui marche pas ds ton progµ?
> > > > Precision!
> > > > Veni Vidi Vici
> > > >
> > > >
> > > > -------------------------------
> > > > Réponse au message :
> > > > -------------------------------
> > > >
> > > > > j'ai un souci pkoi ca marche paaa,ouinnn, aider moi sivoupléééé,thanks a tous les mecs qui touchent tellement qui sauront trouver la finte,
> > > > >
> > > > >
> > > > > #include<stdio.h>
> > > > > #define TAILLE 20
> > > > > typedef struct{
> > > > > char nom [10];
> > > > > char prenom [10];
> > > > > char sexe;
> > > > > float salaire[1000];
> > > > > }t_personne;
> > > > > t_personne fiche [TAILLE];
> > > > >
> > > > > int nbfiches=-1;
> > > > >
> > > > > /*effacer l'ecran*/
> > > > > void e_effacer() {
> > > > > system ("clear");
> > > > > }
> > > > >
> > > > > /*creer une entete*/
> > > > > void e_entete (){
> > > > > e_effacer();
> > > > > printf("\n\t projetc");
> > > > > pystem ("clear");
> > > > > intf("\n\t faites vous plaisir");
> > > > > }
> > > > >
> > > > > /*menu principal*/
> > > > > void e_principal(){
> > > > > e_entete ();
> > > > > printf ("\n\n\t 1 : ajouter une personne");
> > > > > printf ("\n\n\t 2 : lister le personnel");
> > > > > printf ("\n\n\t 3 : quitter");
> > > > > printf ("\n\n\t\t\t Choix:");
> > > > > }
> > > > >
> > > > > /*fonction pour ajouter une personne*/
> > > > > void ajouter_une_personne(){
> > > > > e_entete();
> > > > > printf("\n promo 20,vivi nous");
> > > > > printf("\n AJOUTER UNE PERSONNE");
> > > > > printf("\n NOM:");
> > > > > scanf("%s",fiche [nbfiches+1].nom);
> > > > > printf("\n PRENOM:");
> > > > > scanf("%s",fiche [nbfiches+1].prenom);
> > > > > printf("\n SEXE: m ou f");
> > > > > scanf("%s",&fiche[nbfiches+1].sexe);
> > > > > printf("\n SALAIRE:");
> > > > > scanf("%f",&fiche[nbfiches+1].salaire);
> > > > > nbfiches++;
> > > > > }
> > > > >
> > > > > /*fonction lister tout le personnel*/
> > > > > void lister_tout_le_personnel(){
> > > > > int i=0;
> > > > > if (nbfiches >=0){
> > > > > for(i=0;i<=nbfiches;i++){
> > > > > printf("\n noms:");
> > > > > printf("%s",fiche[i].nom);
> > > > > printf("\n prenom:");
> > > > > printf("%s",fiche[i].prenom);
> > > > > printf("\n salaire:");
> > > > > printf("%f",fiche[i].salaire);
> > > > > getchar();
> > > > > }}}
> > > > >
> > > > > /*fonction lister toutes les femmes*/
> > > > > void lister_toutes_les_femmes(){
> > > > > int i,choix;
> > > > > for(i=0;i<=nbfiches;i++){
> > > > > if(fiche[i].sexe=='f'){
> > > > > printf("vive nous");
> > > > > printf("\n noms:");
> > > > > printf("%s",fiche[i].nom);
> > > > > printf("\n prenom:");
> > > > > printf("%s",fiche[i].prenom);
> > > > > printf("\n salaire:");
> > > > > printf("%f",fiche[i].salaire);
> > > > > getchar();
> > > > > }}}
> > > > >
> > > > > /*fonction lister tous les hommes*/
> > > > > void lister_tous_les_hommes(){
> > > > > int i,choix;
> > > > > for(i=0;i<=nbfiches;i++){
> > > > > if(fiche[i].sexe=='h'){
> > > > > printf("vive nous");
> > > > > printf("\n noms:");
> > > > > printf("%s",fiche[i].nom);
> > > > > printf("\n prenom:");
> > > > > printf("%s",fiche[i].prenom);
> > > > > printf("\n salaire:");
> > > > > printf("%f",fiche[i].salaire);
> > > > > getchar();
> > > > > }}}
> > > > >
> > > > > /*menu secondaire pour lister les gens*/
> > > > > void e_secondaire(){
> > > > > system ("clear");
> > > > > int choix;
> > > > > printf ("\n 1 : lister tout le personnel");
> > > > > printf ("\n 2 : lister toutes les femmes");
> > > > > printf ("\n 3 : lister tous les hommes");
> > > > > printf ("\n 4 : retour au menu principal");
> > > > > printf ("\n\n\t\t\t Choix : ");
> > > > > do{
> > > > > scanf("%d",&choix);
> > > > > switch(choix){
> > > > > case 1: lister_tout_le_personnel ();
> > > > > case 2: lister_toutes_les_femmes ();
> > > > > case 3: lister_tous_les_hommes ();
> > > > > case 4: e_principal ();break;
> > > > > }}
> > > > > while(choix<1||choix>4);
> > > > > }
> > > > > int main(){
> > > > > int choix;
> > > > > do{
> > > > > do{
> > > > > e_principal ();
> > > > > scanf("%d",&choix);
> > > > > switch(choix){
> > > > > case 1: ajouter_une_personne ();
> > > > > break;
> > > > > case 2: e_secondaire ();
> > > > > break;
> > > > >
> > > > > case 3: break;
> > > > > }
> > > > > }
> > > > > while (choix<1||choix>3);
> > > > > }
> > > > > while (choix!=3);
> > > > > }
> > > >
> > >
> >
>
mercredi 25 juin 2003 à 16:53:34 | Re : pkoi c amarche pas !!!!!!!!!!!

Xentor609

Salut,
voila j'ai teste le prog, y'avait quelques ptit prob
comme le listage des hommes par exemple et d'autres encore.
J'ai donc modifie et maintenant il marche bien(pas fait de gestion d'erreur)
Par contre faudra que tu modifies certaine fonctions comme _getch() (je sais pas si ca existe sous linux) ou system("cls"),

#include<stdio.h>
#include<process.h>
#include <conio.h>

#define TAILLE 20
typedef struct{
char nom [10];
char prenom [10];
char sexe;
float salaire;
}t_personne;

t_personne fiche [TAILLE];

int nbfiches=-1;

/*effacer l'ecran*/
void e_effacer()
{
system ("cls");
}

/*creer une entete*/
void e_entete ()
{
e_effacer();
printf("\n\t projetc");
system ("cls");
printf("\n\t faites vous plaisir");
}

/*menu principal*/
void e_principal()
{
e_entete ();
printf ("\n\n\t 1 : ajouter une personne");
printf ("\n\n\t 2 : lister le personnel");
printf ("\n\n\t 3 : quitter");
printf ("\n\n\t\t\t Choix: ");
}

/*fonction pour ajouter une personne*/
void ajouter_une_personne()
{
e_entete();
printf("\n promo 20,vivi nous");
printf("\n AJOUTER UNE PERSONNE");
printf("\n NOM: ");
scanf("%s",fiche [nbfiches+1].nom);
printf("\n PRENOM: ");
scanf("%s",fiche [nbfiches+1].prenom);
printf("\n SEXE: m ou f: ");
scanf("%s",&fiche[nbfiches+1].sexe);
printf("\n SALAIRE: ");
scanf("%f",&fiche[nbfiches+1].salaire);
nbfiches++;
}

/*fonction lister tout le personnel*/
void lister_tout_le_personnel()
{
int i=0;
if (nbfiches !=0)
{
for(i;i<=nbfiches;++i)
{
printf("\n");
printf("\n noms: ");
printf("%s",fiche[i].nom);
printf("\n prenom: ");
printf("%s",fiche[i].prenom);
printf("\n salaire: ");
printf("%f",fiche[i].salaire);
_getch();
}
}
}

/*fonction lister toutes les femmes*/
void lister_toutes_les_femmes()
{
int i=0;//,choix;
for(i;i<=nbfiches;i++)
{
if(fiche[i].sexe=='f')
{
printf("\n");
printf("vive nous");
printf("\n noms: ");
printf("%s",fiche[i].nom);
printf("\n prenom: ");
printf("%s",fiche[i].prenom);
printf("\n salaire: ");
printf("%f",fiche[i].salaire);
printf("\n");
_getch();
}
}
}

/*fonction lister tous les hommes*/
void lister_tous_les_hommes()
{
int i;//,choix;
for(i=0;i<=nbfiches;i++)
{
if(fiche[i].sexe=='m')
{
printf("\n");
printf("vive nous");
printf("\n noms: ");
printf("%s",fiche[i].nom);
printf("\n prenom: ");
printf("%s",fiche[i].prenom);
printf("\n salaire: ");
printf("%f",fiche[i].salaire);
printf("\n");
_getch();
}
}
}

/*menu secondaire pour lister les gens*/
void e_secondaire()
{
system ("cls");
int choix;
printf ("\n 1 : lister tout le personnel");
printf ("\n 2 : lister toutes les femmes");
printf ("\n 3 : lister tous les hommes");
printf ("\n 4 : retour au menu principal");
printf ("\n\n\t\t\t Choix : ");
do
{
scanf("%d",&choix);
switch(choix)
{
case 1: lister_tout_le_personnel ();break;
case 2: lister_toutes_les_femmes ();break;
case 3: lister_tous_les_hommes ();break;
case 4: e_principal ();break;
}
}

while(choix<1||choix>4);
}

int main()
{
int choix;
do
{
do
{
e_principal ();
scanf("%d",&choix);
switch(choix)
{
case 1: ajouter_une_personne ();
break;
case 2: e_secondaire ();
break;
case 3: break;
}
}
while (choix<1||choix>3);
}
while (choix!=3);
return (0);
}



Voila, donc compilé sous VC6, mais pas gd chose a modifie pour gcc normalement
-------------------------------
Réponse au message :
-------------------------------

> j'ai un souci pkoi ca marche paaa,ouinnn, aider moi sivoupléééé,thanks a tous les mecs qui touchent tellement qui sauront trouver la finte,
>
>
> #include<stdio.h>
> #define TAILLE 20
> typedef struct{
> char nom [10];
> char prenom [10];
> char sexe;
> float salaire[1000];
> }t_personne;
> t_personne fiche [TAILLE];
>
> int nbfiches=-1;
>
> /*effacer l'ecran*/
> void e_effacer() {
> system ("clear");
> }
>
> /*creer une entete*/
> void e_entete (){
> e_effacer();
> printf("\n\t projetc");
> pystem ("clear");
> intf("\n\t faites vous plaisir");
> }
>
> /*menu principal*/
> void e_principal(){
> e_entete ();
> printf ("\n\n\t 1 : ajouter une personne");
> printf ("\n\n\t 2 : lister le personnel");
> printf ("\n\n\t 3 : quitter");
> printf ("\n\n\t\t\t Choix:");
> }
>
> /*fonction pour ajouter une personne*/
> void ajouter_une_personne(){
> e_entete();
> printf("\n promo 20,vivi nous");
> printf("\n AJOUTER UNE PERSONNE");
> printf("\n NOM:");
> scanf("%s",fiche [nbfiches+1].nom);
> printf("\n PRENOM:");
> scanf("%s",fiche [nbfiches+1].prenom);
> printf("\n SEXE: m ou f");
> scanf("%s",&fiche[nbfiches+1].sexe);
> printf("\n SALAIRE:");
> scanf("%f",&fiche[nbfiches+1].salaire);
> nbfiches++;
> }
>
> /*fonction lister tout le personnel*/
> void lister_tout_le_personnel(){
> int i=0;
> if (nbfiches >=0){
> for(i=0;i<=nbfiches;i++){
> printf("\n noms:");
> printf("%s",fiche[i].nom);
> printf("\n prenom:");
> printf("%s",fiche[i].prenom);
> printf("\n salaire:");
> printf("%f",fiche[i].salaire);
> getchar();
> }}}
>
> /*fonction lister toutes les femmes*/
> void lister_toutes_les_femmes(){
> int i,choix;
> for(i=0;i<=nbfiches;i++){
> if(fiche[i].sexe=='f'){
> printf("vive nous");
> printf("\n noms:");
> printf("%s",fiche[i].nom);
> printf("\n prenom:");
> printf("%s",fiche[i].prenom);
> printf("\n salaire:");
> printf("%f",fiche[i].salaire);
> getchar();
> }}}
>
> /*fonction lister tous les hommes*/
> void lister_tous_les_hommes(){
> int i,choix;
> for(i=0;i<=nbfiches;i++){
> if(fiche[i].sexe=='h'){
> printf("vive nous");
> printf("\n noms:");
> printf("%s",fiche[i].nom);
> printf("\n prenom:");
> printf("%s",fiche[i].prenom);
> printf("\n salaire:");
> printf("%f",fiche[i].salaire);
> getchar();
> }}}
>
> /*menu secondaire pour lister les gens*/
> void e_secondaire(){
> system ("clear");
> int choix;
> printf ("\n 1 : lister tout le personnel");
> printf ("\n 2 : lister toutes les femmes");
> printf ("\n 3 : lister tous les hommes");
> printf ("\n 4 : retour au menu principal");
> printf ("\n\n\t\t\t Choix : ");
> do{
> scanf("%d",&choix);
> switch(choix){
> case 1: lister_tout_le_personnel ();
> case 2: lister_toutes_les_femmes ();
> case 3: lister_tous_les_hommes ();
> case 4: e_principal ();break;
> }}
> while(choix<1||choix>4);
> }
> int main(){
> int choix;
> do{
> do{
> e_principal ();
> scanf("%d",&choix);
> switch(choix){
> case 1: ajouter_une_personne ();
> break;
> case 2: e_secondaire ();
> break;
>
> case 3: break;
> }
> }
> while (choix<1||choix>3);
> }
> while (choix!=3);
> }


Cette discussion est classée dans : printf, ajouter, void, fiche, nbfiches


Répondre à ce message

Sujets en rapport avec ce message

Pb peut etre de compilateur ?! Need Help please [ par Orezza ] Orezzasalut à tous, je ne comprends vraiment pas le Pb, le compilateur Visual C++ indique 0 erreur-0 warning, or kand j'execute mon prog des ke je ren Assez Urgent problème de gestion dans les fichiers [ par bugs2600 ] Salut,Je suis en train de faire un programme de gestion de fichier mais j'ai un problème pour faire une fonction de suppression des menbres.Voici ce q Pb d'affichage avec des listes doublement chianées [ par Orezza ] Bonjour a tous,voila je dois faire un petit analyseur syntaxique, en ce moment j'en suis au prémice de mon code et j'ai dejà un Big problem d'affichag bitte hilfe!!!!!!!!! [ par sansan_2 ] Bonjour!!!!!!!! le programme c est un FIFO (ringpufffer) et j aimerais avoir une amelioration. Apres execution du programme, faire une tabulation, un Liste chainéés [ par anek971 ] Bonjour a tousEnfaite il y a déà eu un poste sur le site sur ce sujet mais ayant le mm tp a faire je me suis rendu compte ke sa fonction quitter ne ma base de donne [ par bigNB ] bjr je doi realiser une connection a une base de donness.etan donne que j avais tres peu de temps j ai repris une source dun programmeurelle va correc Bug windows avec mon programme (nivo débutant) [ par MATHIS49 ] Bonjour ! Etant un gros debutant en C je m'essai à faire un programme d'amortissement tout simple. Mais le probleme c'est que windows plante lorsque j probleme avec la modification de fichier texte [ par marabou ] voila g un pb car g doi fer une gestion de bibliotheque et dc g arrive a entré ds livre a regarder ms stock ms g aimerai modifier le fichier texte cad Liste chainée en C [ par Mo0d ] Bonjour, je suis étudiant en 1ère informatique de gestion et j'ai eu quelques problèmes à mon examen d'algorithmiques(que je vais devoir repasser bien probleme (segmentation) d'execution d'un thread [ par krusty24 ] salut tout le monde j'ai besoin de votre aide pour m'aider a resoudre un petit probleme d'execution de mon programme en C-ANSI ce programme permet de


Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,827 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales