int main()
{
typedef char color [50];
color colores[5];
}
if (colores[i]==colores[i+1])
Colores.c:23:16: error: 'colores' undeclared (first use in this function)
ret= strcmp(colores[i],colores[i+1]);
^~~~~~~~~
Colores.c:23:16: note: each undeclared identifier is reported only once for each function it appears in
for (i=0;i<5;i++)
{
int ret;
ret= strcmp(colores[i],colores[i+1]); //esta línea es la que da error
if(ret < 0)
{
printf("str1 es menor que str2");
}
else if(ret > 0)
{
printf("str2 es menor que str1");
}
else
{
printf("str1 son iguales to str2");
}
return(0);
}