Reputation: 3520
This is my code:
struct opts
{
int a;
int b;
};
class myclass
{
private:
opts options;
public:
void afunction();
}
//myclass.cpp
void myclass::afunction()
{
if options.a==1
//do something
}
When I compile it I am getting the follwoing error.
error C2061: syntax error : identifier options
What is wrong with it?
Upvotes: 0
Views: 1242
Reputation: 258678
if options.a==1
is wrong. The condition has to be surrounded by parenthesis.
if (options.a==1)
Upvotes: 4