Question: C++ Liar's Dice code is throwing 2 errors. Severity Code Description Project File Line Suppression State Error LNK1120 1 unresolved externals 1 Error LNK2019 unresolved

C++ Liar's Dice code is throwing 2 errors.

Severity Code Description Project File Line Suppression State Error LNK1120 1 unresolved externals 1 Error LNK2019 unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) C:\######\MSVCRTD.lib(exe_main.obj) 1

CODE

#include "stdafx.h" #include #include #include #include

using namespace std;

const int DICE = 4;

class Player //Player Class {

private: string name; int diceLeft; int hand[DICE];

public: //constructor Player(string theName); int diceCount[6];

//methods void roll(); void show(); void count(); };

//Player constructor definition Player::Player(string theName) { name = theName; diceLeft = DICE; } //Player method definitions

void Player::roll() { for (int i = 0; i < diceLeft; ++i) { hand[i] = 1 + rand() % 6; } }

void Player::show() { for (int i = 0; i < diceLeft; ++i) { cout << hand[i] << endl; } }

void Player::count() { for (int i = 0; i < 6; ++i) { diceCount[i] = 0; }

for (int n = 0; n < diceLeft; ++n) { diceCount[hand[n] - 1]++; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!