i am trying to call a function into a main program file, please can somesone help me.
'game.h' file -
// game.h: interface for the game class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_GAME_H__5304BDEF_6A7E_4CA9_AE3A_0B70F 82C6829__INCLUDED_)
#define AFX_GAME_H__5304BDEF_6A7E_4CA9_AE3A_0B70F82C6829__ INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class game
{
public:
game();
virtual ~game();
play();
};
#endif // !defined(AFX_GAME_H__5304BDEF_6A7E_4CA9_AE3A_0B70F 82C6829__INCLUDED_)
'game.cpp' file -
// game.cpp: implementation of the game class.
//
//////////////////////////////////////////////////////////////////////
#include "game.h"
#include <iostream>
using namespace std;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
game::game()
{
}
game::~game()
{
}
game::play() - Note thats PLAY function, with a p where the smiley is
{
cout<<"Welcome to the Vegas Fruit Mahcine"<<endl;
return 0;
}
'main.cpp' file -
#include <iostream>
#include "game.h"
using namespace std;
int main()
{
play();
return 0;
}
please can someone show me or tell me how to call the play function to the mian.cpp file. i know i have to put '-----.play()', but i don't know what or how to replace the ---- bit with.
Disable Smilies in This Post ticked by Salem