getting this error:
1>c:\users\b1021568\documents\visual
studio 2010\projects\tarefa42\tarefa
42\main.cpp(112): error C2664: 'cria_aluno' : cannot convert parameter 2 from 'const char [7]' to 'char' 1> There is no context in which this conversion is possible
when trying to compile this:
int main(void)
{
Aluno *a[5];
a[0] = cria_aluno(1, "turma1", "Joao", 7.0, 8.4, 4.3);
a[1] = cria_aluno(2, "turma2", "Maria", 3.2, 5.1, 10.0);
a[2] = cria_aluno(3, "turma3", "Rafael", 8.1, 3.2, 4.5);
a[3] = cria_aluno(4, "turma4", "Jose", 1.3, 7.7, 9.3);
a[4] = cria_aluno(5, "turma5", "Lais", 4.5, 1.3, 9.9);
ordena(5, a);
return 0;
}
thats my cria_aluno function:
Aluno *cria_aluno(int mat, char turma, char nome, float p1, float p2, float p3)
{
Aluno *a;
a = (Aluno*) malloc(sizeof(Aluno));
if(a == NULL)
{
printf("Memoria insuficiente");
return NULL;
}
a->mat = mat;
a->turma = turma;
strcpy(a->nome, nome);
a->p1 = p1;
a->p2 = p2;
a->p3 = p3;
return a;
}