Question
Question about C++ Graphics. I keep getting the error type name not allowed in visual studios and not sure the cause. In the
Question about C++ Graphics. I keep getting the error "type name not allowed" in visual studios and not sure the cause. In the project I am using pointers and GLUT not sure if the error is as a result of the pointers or a compatibility issue with GLUT itself. If you need any more information from just let me know.
Code:
#include #include #include "graph1.h"
using namespace std;
//Protoypes void getDiceCount(int* noDice); void rollDice(int* dice, int noDice); void computeScore(int* dice, int noDice, int* score); void displayResults(int* dice, int noDice, int score);
int main() { //Variable Declaration/Initialization int noDice = 0; const int MAX_DICE = 5; int dice[MAX_DICE] = { 0 }; int score = 0;
char repeat;
//Initialize random number generator srand(time(0));
//Display Graphics displayGraphic();
do {
//1. Get the number of dice to roll getDiceCount(&noDice);
//2. Roll the Dice (i.e., generates a random number for each dice rollDice(int* dice, int* noDice);
//3. Compute the score computeScore(dice, noDice, score);
//4. Display the dice and results displayResults(dice, noDice, score);
} while return 0; }
//Functions void getDiceCount(int* noDice) { //Prompts for the number of Dice to display and stores in the noDice variable //User input should be between 1 and 5 inclusively reprompt if not within range cout > *noDice; }
void rollDice(int* dice, int noDice) { //Generates noDice random numbers corresponding to the rolling of the dice //Each random number is stored in the dice parameter //Each random number should be stored int i = 0;
for (i = 0; i
} }
void computeScore(int* dice, int noDice, int* score) { //Variable Declaration int i = 0; *score = 0;
//Adds up each random number stored in the dice array //Stores the result in the score parameter
for (i = 0;) i, noDice; i++) {
*score dice[i]; } }
void displayResults(int* dice, int noDice, int score) { //Display each Die starting at 100,100 //Each Die has a width of 104
int i = 0; int x = 10 0; int y = 100;
for (i = 0; i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started