feedback

(Solution document) I have two questions, first im having trouble with my number generator in the class gameRounds. Visual studio is giving me the errors C3867 and C2672....


I have two questions, first im having trouble with my number generator in the class gameRounds. Visual studio is giving me the errors C3867 and C2672. Secondly how do i go about initiating a class in the main class so it will run. I want to run them and test them to see if they are working but cant get them called in the main class.



#include "stdafx.h"

#include

#include

#include

#include

#include

#include





using namespace std;


int main()

{

string line_;

ifstream file_("rules.txt");

if (file_.is_open())

{

while (getline(file_, line_))

{

std::cout << line_ << "n";

}

file_.close();

}



return 0;

}






class gameRounds {

public:

int size;

int reRoll;

int getRandom() { return rand() % 6 + 1; }




int rollingDie()

{

cout << "How many die will you role? n";

cin >> size;

for (int i = 0; i < size; i++)

{

vectordieVector(size);

generate(dieVector.begin(), dieVector.end(), getRandom);

cout << dieVector[i] << " ";

}


}



};


class Player {

public:

vectorplayerName;

int numPlayers;

int loopCount = 0;

string input;

string getPlayerName() 

{

cout << "How many players are there? n";

cin >> numPlayers;


while (numPlayers > loopCount)

{

cout << "What are the players names? n";

cin >> input;

playerName.push_back(input);

loopCount++;

}



}


};

 







About this question:

Pay using PayPal (No PayPal account Required) or your credit card. All your purchases are securely protected by .
SiteLock