I'm trying to create a code that creates a list of points. I have a file named "punti.c" with its header and a file named "item.c" with its header. The problem is that I can't access the variables of the struct point(x,y) from the item.
//item.c
#include <stdio.h>
#include "item.h"
#include "punti.h"
int eq(item it1, item it2)
{
return it1->x == it2->x; //the problem is here
}
//item.h
#include "punti.h"
typedef Punto item;
int eq(item x, item y);
//punti.c
#include "utilities.h"
#include "punti.h"
#include <math.h>
struct punto
{
double x;
double y;
};
//punti.h
typedef struct punto *Punto;
I tested the type Punto in many ways, so I'm sure it works. I tried to change the typedef of item, made it a pointer to Punto, but it didn't work. (Part of the code is in Italian, sorry:) )