bool from a struct lead to "error: expression must have class type"
I have a struct defined as
struct sData{
idx * id;
int * stime;
bool * result;
unsigned int N;
};
Then the code that uses it in
numeric compute(numeric e, sData swabs){
numeric cache=0.0;
int sid=0;
while(sid<swabs.N){
if(swab.result[sid])
cache += log(e);
else cache += log(1.0-e);
sid += 1;
}
return cache;
}
but when compiling I get the error.
paug_cuda.cu(602): error: expression must have class type
What is this supposed to mean. w开发者_开发问答hat class type? I'm using a bool in a logical expression. what else could there be to this. What am I missing?
swab
-> swabs
:)
The error means that you wrote something like X.Y and X is not an instance of a class/struct.
精彩评论