S
Sandy Beech
Hey
I'm trying to dynamically allocate space for a struct, and I get this
error:
"appCheck.c", line 159: warning(1515): a value of type "struct Minipath
*"
cannot be assigned to an entity of type "struct MiniPath *"
which makes no sense to me. I have to use cc to compile because it is
the only thing available on some machines where this needs to run. On my
machine I get the above warning, but if I run it, it works correctly.
Problem is, I need it to run on a different machine where that is an
error, not a warning. What am I missing? Any help?
It's declared:
struct MiniPath
{
char third [15];
char* fourth [15];
int places;
};
Then in another struct:
struct Path
{
char second [15];
struct MiniPath* path [15];
int splits;
} pathList[200];
And later:
pathList[currPath].path[pathList[currPath].splits] =
(struct Minipath *)malloc(sizeof(char[15])+sizeof(struct MiniPath*[15])
+sizeof(int));
I'm trying to dynamically allocate space for a struct, and I get this
error:
"appCheck.c", line 159: warning(1515): a value of type "struct Minipath
*"
cannot be assigned to an entity of type "struct MiniPath *"
which makes no sense to me. I have to use cc to compile because it is
the only thing available on some machines where this needs to run. On my
machine I get the above warning, but if I run it, it works correctly.
Problem is, I need it to run on a different machine where that is an
error, not a warning. What am I missing? Any help?
It's declared:
struct MiniPath
{
char third [15];
char* fourth [15];
int places;
};
Then in another struct:
struct Path
{
char second [15];
struct MiniPath* path [15];
int splits;
} pathList[200];
And later:
pathList[currPath].path[pathList[currPath].splits] =
(struct Minipath *)malloc(sizeof(char[15])+sizeof(struct MiniPath*[15])
+sizeof(int));