|
|
bonjour a tous
lorsque j essaye de compile se petit programme :
sa m affiche plusieur erreurs
9 C:\Documents and Settings\SansNom1.cpp `fonction' undeclared (first use this function)
15 C:\Documents and Settings\SansNom1.cpp `int fonction(char*)' used prior to declaration
...
#include <stdlib.h>
#include <stdio.h>
int main(int ac,char **av)
{
if (ac == 2)
fonction(av[1]);
else
exit (0);
}
int fonction(char *str)
{
int a = 0;
int b = 0;
while (str[a] != '\0')
{
if (a > 0 && str[a] != str[a-1])
{
aff(b,str[a - 1]);
b = 1;
}
else
b++;
a++;
}
}
int aff(int a,char c)
{
printf("%d %c a la suite\n", a , c);
}
system("PAUSE");
return 0;
}
|