error: expected primary-expression before ‘)’ to ken cast issue
- From: Bill Brown <wbrown338 comcast net>
- To: gtk-list gnome org
- Subject: error: expected primary-expression before ‘)’ to ken cast issue
- Date: Sat, 2 Aug 2014 10:14:57 -0500
Hello. I'm trying to figure out why I get a compile error (in the subject of this message) for this cast during the initialization of a struct member variable.
in myclass.h
class MyClass {
...
public:
struct cpresets {
char* soundfont_key;
char* exists;
UT_hash_handle hh;
};
...
};
in myclass.cc
void myclass::mymethod() {
...
struct cpresets *newpreset;
newpreset = (cpresets*) malloc(sizeof( cpresets));
...
}
There is another place in the cc file where this works.
in myclass.cc
...
typedef struct {
...
}mystruct;
...
static instantiate(){
...
//this line causes the compile error
mystruct* me = (mystruct*) malloc(sizeof(mystruct));
...
}
I see the difference in the case where it works is that the struct is defined in the cc file and in the case where it doesnt work, the struct is a member vairable of the class header. Do you know why this is an issue or what I might be able to do to fix it?
Thanks.
Bill.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]