Non standard syntax error

I just tried running my program after defining the fBullCowGame::reset() function and am getting this error;

Severity Code Description Project File Line Suppression State
Error C3867 ‘fBullCowGame::reset’: non-standard syntax; use ‘&’ to create a pointer to member BullCowGame c:\users\scott_yoc1uey\documents\visual studio 2015\projects\bullcowgame\bullcowgame\bullcowgame.cpp 42

here is what I have;

#include "stdafx.h"
#include "fBullCowGame.h"
fBullCowGame::fBullCowGame(){ reset(); }
int fBullCowGame::getMaxTries() const { return myMaxTries; }
int fBullCowGame::getCurrentTry() const { return myCurrentTry; }
void fBullCowGame::reset()
{
	constexpr int MAX_TRIES = 8;
	myMaxTries = MAX_TRIES;
	myCurrentTry = 1;
	
	return;
}

EDIT: FIXED Just forgot to put a () after function call in main code

Try rebuilding your solution. The error is basically says you haven’t got () at the end of reset when you’re trying to call it.

Basically as if you have written something like

fBullCowGame::fBullCowGame() { reset; } //missing()

edit: nvm then I guess lol just saw the edit. Guess I should have refreshed the page before clicking on the links.

You literally just saved me from a cave of depression and self doubt! haha Parenthesis! Yarg! Thank you so much!!!

Privacy & Terms