Langage C - Les tableaux

Metabolic - 7 déc. 2010 à 16:15
 youssef - 31 janv. 2011 à 13:38
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.

https://www.commentcamarche.net/contents/c/ctab.php3

svp sa fait 3 jours que je cherche ou se trouve l'anomalie dans ce programme et je l'ai pas encore trouver j'espère bien avoir un soutien de votre pare ces le suivant:

include<stdio.h>

include<conio.h>

include<string.h>

include<stdlib.h>

main () { int n; int tab[50],min,i,j,pos;

printf ("Entrer le nombre d'element souhaiter: ");
scanf("%d",&n);

for(i=0;i<n;i++) { printf(« Enter Element NUMERO: »); scanf(« %d »,tab[i]);

printf ("\n Enter LA VALEUR souhaiter de cette element : ");
scanf ("%d",(tab+i));

}

for(i=0;i<(n-1);i++) pos=0; { min=tab[i]; j=0; for(j=i;j<n;j++) { if(tab[j]<=min) { min=tab[j]; pos=j; } }

for(j=pos;j>i;j--)
{
tab[j]=tab[j-1];
}

tab[i]=min; } for(i=0;i<n;i++) { printf(« %d\n »,tab[i]); }

getch(); }
memset(*toto, 0, sizeof(toto));
mauvais appel de fonction au niveau de *toto :
expected `void *' but argument is of type `int'
->&toto...