I have a header and body code as follows:
Code:
#pragma once
typedef void * Comparable;
class Sort1
{
public:
Sort1(void);
~Sort1(void);
private:
};
Code:
#include ".\sort1.h"
#include "Bag_Ptr.h"
#include "Card.h"
#include "stdafx.h"
#include <iostream>
using namespace std;
Sort1::Sort1(void)
{
char suits[] = "HSCD";
char denom[] = "23456789tJQKA";
// a full deck of cards
//creating card objects and placing them in a bag
Bag_Ptr CardDeck(52);
for (int s=0; s<4; s++) for (int d=0; d<13; d++) CardDeck.Add((Card *) new Card(suits[s],denom[d]));
Card * card_array[10];
for (int i = 0; i < 10; i++){
card_array[0] = (Card *) CardDeck.GetOne();
}
for (int j = 0; j < 10; j++){
cout << j + 1 << ": " << card_array[j]->GetDenomination() << " of " << card_array[j]->GetSuit();
if (j == 9){
cout << "/n";
}
else {
cout << ", ";
}
}
}
Sort1::~Sort1(void)
{
}
and its giving weird errors upon compilation like at Sort1::Sort1(void), it gives an error of "'Sort1' is not a class or namespace name" and also gives undeclared identifier for my Bag_Ptr class (the class works because im reusing it from a different program). And it just seems like its not using the include statements or something. Any help is appreciated.
Thanks
cram