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

** Errar List * Saarch Fror list Ao Wuirings (X)13 Eirui 0O Messeges Entire Solution Build + Intellisense rile Labzm.pp Code Description A Project Line argument of type "int is incompatible with parameter of type "int " Lab2IN 38 X) C1083 Cannat open include file: 'gl/glt.h': Na such fik ar drectory Lab2IN graph1.h 44 cannot apan soure file "glgluth Lab2IN graph1.h 44 cxpected a Lab2IN Lab2ln.cpp 44 * FOOGS expected a Lab?IN Lab?In.gap 24 N CO065 Lab2IN expecled a Lab2ln.upp 70 cxpected a Lab2IN Labln.cpp a3 * E0029 expecled ari eapiessiuri LabZIN Lubzlnupp 14 * CO029 exuected arn upiession Lab2IN Lab2ln.upp 03 * HO020 identifier "displayliraphic is undefined Lah2IN Labeln.pp 21 E E0155 * HOP'14 Lubzlnpp lvo lew erguirerils iri luncliori call Lab2IN 105 Type name is not alkwad TahIN TabIn.cmp Labzln.gop type name is not allewed Lab2IN 35
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
