I want to make sure i'm calling functions correctly. The functions that are in another .cpp are makeDeck()
and shuffle()
. I also do not know how to make a relevant header file or when they are helpful. Could someone write or walk me through the syntax of my deck.cpp
and deck.h
files that will work with the following:
main.cpp
#include <iostream>
#include "deck.h"
using namespace std;
int main() {
int size;
do {
cout << "Enter size of deck (5-50): " << endl;
cin >> size;
} while (size<5 || size>50);
int** deck[size] = makeDeck(size);
shuffle(deck);
int score = 0;
char guess = NULL;
for (int** i = **deck; *i != NULL; i++) {
cout << "Score: " + score << endl;
cout << "Current card: " + *i<< endl;
cout << "Will the next card be higher (high) or lower (low) than " + *i + "?" << endl;
cin << guess;
if (guess == "higher" || guess == "high") {
if (*(i + 1) > *i)
score++;
else
score--;
}
if (guess == "lower" || guess == "low") {
if (*(i + 1) < *i)
score++;
else
score--;
}
}
}