0
I am not able to compile my program, the compiler keeps accusing "array type has incomplete element type" in the function that prints points.
The function that prints dot:
float imprimePonto(struct armazenar p[], int n)
{
int i;
for(i=0;i<n;i++)
{
printf("(%9.2f, %9.2f)\n",p[i].x,p[i].y);
}
return 0;
}
the struct:
struct armazenar
{
float x;
float y;
};
main:
#define MAX 10
int main()
{
struct armazenar p[MAX];
int n=0;
n=func_lerN();//recebendo o numero de vetores que o usuario quer digitar.
func_lerVetor(n);
imprimePonto(p[MAX],n);
return 0;
}
as this is being declared the array in the main code?
– TotallyUncool
Visual Studio Express works perfectly.
– lsalamon
Put the struct code in the same file, above the declaration of your function.
– jsbueno
failed to put the struct code in the same file.
– soAna
Compiling as? (Which Compiler, which environment, which build command, etc)? What structure (it’s all in the same file
.c
with no one header?)?– Anthony Accioly
has a header and I use code Blocks
– soAna
Possible duplicate of how do I access the values of a struct?
– Brumazzi DB