Simply put, I have the following code (simplified):
void Example()
{
struct AuctionVars auction;
memset(&auction, 0, sizeof(struct AuctionVars));
}
And I have the following struct:
struct AuctionVars
{
float minBidIncrement;
int numAuctionItems;
float* auctionItemValues;
};
When I change it to this:
struct AuctionVars
{
float minBidIncrement;
int numAuctionItems;
float* auctionItemValues;
bool isAuctionClosed;
};
I get a whole lot of errors everywhere my program references or uses an AuctionVars
variable.
I have already found out that the Visual Studio compiler uses C89 and does not support declaring variables anywhere but at the beginning of code blocks, so is this another limitation of C99 where bool types are not supported in structs? Or am I making another one of my foolish mistakes?