我對C++
相當陌生。 和我正在做一個tic tac toe
遊戲,我需要一個隨機生成器來決定哪個玩家先行。 但我初始化變量時出錯。初始化變量時出錯
下面是代碼
#pragma once
#include <string>
#include <random>
#include <ctime>
#include "Board.h"
#include "Player.h"
class manager
{
public:
manager();
void gameEntrance();
void playGame();
void askMove();
void diceRoll();
void winChekcer();
void endGameChecker();
private:
default_random_engine _randomGenerator(time(0)); //here i got "Error: functio "time" is not a type name
uniform_real_distribution<float> _diceRoll(0.0f, 1.0f); //here i got "Error: expected a type specifier
bool _endGame = false;
string _turn;
Board _board;
Player _player1;
Player _player2;
};
所以我做了什麼錯。請賜教。感謝你們。
的地方並把它們放在聲明的順序 – 2014-08-30 07:56:23
非常感謝你。它幫助到我。 好的時候去下一個錯誤。 – GroniumArgor 2014-08-30 07:59:09