Errors C3867 and C2446? Followed a tutorial, i got the link

I'm just following another game dev tutorial, been a while since ive been coding so I'm probably just missing something. Here's the link to the tutorial: https://www.youtube.com/watch?v=shsmu3GX0s4

The errors both occur on line 15 of the main cpp file, with error C3867 saying that 'Game::getPlaying newboi': non-standard syntax; use '&' to create a pointer member. Error C2446 is saying '==': no conversion from 'int' to 'bool(_thiscall Game::*)(void) const'

here is that file's code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>

#include "Game.h"



using namespace std;

int main()
{
	srand(time(NULL));

	Game rpg;

//this boi under me is the problem

	while (rpg.getPlaying == true)
	{
		rpg.mainMenu();
	}

	return 0;
}


and heres the game.h file that it comes from.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef GAME_H
#define GAME_H

#include <iostream>
#include <string>
#include <iomanip>
#include <ctime>

#include "Functions.h"

using namespace std;

class Game
{
public:
	Game();
	virtual ~Game();

	void mainMenu();

//I'm assuming this is where the problem comes from?

	inline bool getPlaying() const { return this->playing; }

private:
	int choice;
	bool playing;
};

#endif 
Last edited on
What is the error??? We are not psychic.

You have over 30 posts here. Edit your post and add [code] and [/code] around your code so that it is properly formatted.

getPlaying is a function. You need to call a function with parentheses, e.g. rpg.getPlaying();
Last edited on
I am so sorry lmao its been forever since ive been here, and now I feel like an idiot, dear god
Last edited on
It's all good. My bad if I came off as too harsh.
It's fine, I mean I really should know better at this point and its probably best I get criticism as my worst quality when it comes to this is the way I format and layout things in code and forums, I make it really sloppy and I've really gotta fix that anyways.
Topic archived. No new replies allowed.