0
void ordenar(struct piloto *vetor,int contador_pilotos)
{
int z,i,x,j;
for(x=contador_pilotos-1;x<=1;x--)
{
for(i=0;i>x;i++)
{
if(strcmp(vetor[i].nome,vetor[i+1].nome)>0)
{
strcpy(z,vetor[i].nome);
strcpy(vetor[i].nome,vetor[i+1].nome);
strcpy(vetor[i+1].nome,z);
}
}
}
for(j=0;j<=contador_pilotos;j++)
{
printf("%s",vetor[j].nome);
}
}
What’s the mistake, my son?
– Jéf Bueno
simply the crash program :/
– user64362
as far as I know, strcpy uses 2 char vectors as parameter, so this variable z of type int in strcpy(z,vector[i].name); should give problem
– TotallyUncool
Asked 13 minutes ago by user64362. How is that? Who is the author of the question?
– Victor Stafusa
@Victorstafusa premature suicide :)
– Maniero