I defined the following struct:
typedef struct sp_point_t* SPPoint;
struct sp_point_t
{
int dim;
int index;
double* data;
};
And then I wanted to initialise an instance of the struct:
foo (double* data, int dim, int index)
{
double* dataInserted;
dataInserted = (double*) calloc(dim,sizeof(double));
//inserting values to dataInserted
SPPoint newPoint = {dim, index, dataInserted}; // warning!
}
But at compilation time I got an "excess elements in scalar initializer" warring (on the last line).
What does this warning mean? why can't I initialise an instance this way?
Thanks