Implement Code

Page 1 of 1

1 Replies - 186 Views - Last Post: 25 October 2013 - 03:25 AM Rate Topic: -----

#1 k31453  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 24-October 13

Implement Code

Posted 25 October 2013 - 03:12 AM

I got class BullsAndCowsConsoleView,
subclass this : IBullsAndCowsView
This is what I put in header file of Class.
  #pragma once
#include "IBullsAndCowsView.h"
#include "BullsAndCows.h"
class BullsAndCowsConsoleView : public IBullsAndCowsView
{
	private:
		BullsAndCows& fGameModel;
		bool fActive;

	public:
		BullsAndCowsConsoleView( BullsAndCows& aGameModel );
		virtual int guess();
		virtual void showGuess();
		virtual void startNewGame();
		virtual void endGame();
		virtual void run();
};




This is another 2 Header Files :
#pragma once

#include <string>

class BullsAndCows
{
private:
	int fSecretNumbers[9];
	int fBulls;
	int fCows;

public:
	BullsAndCows();

	void start();
	bool guess( std::string aNumberString );

	int getBulls() const;
	int getCows() const;
};


2nd 

#pragma once
class IBullsAndCowsView
{
	public:
		virtual ~IBullsAndCowsView() {}
		virtual int guess() = 0;
		virtual void showGuess() = 0;
		virtual void startNewGame() = 0;
		virtual void endGame() = 0;
		virtual void run() = 0;
	};


Now I want to cout in BullsAndCowsConsoleView under showguess()

how do i do that ???
i cant use pointer.

Is This A Good Question/Topic? 0
  • +

Replies To: Implement Code

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3712
  • View blog
  • Posts: 5,964
  • Joined: 08-June 10

Re: Implement Code

Posted 25 October 2013 - 03:25 AM

Duplicate thread closed.

Please don't open more than one topic for a single question. If you make mistakes when posting, either just reply with a correction, or - once you reach 16 posts and earn the ability to edit your own posts - edit the first post.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1