Hello
I cannot figure out by myself these errors:
error C2143: syntax error : missing ';' before 'using'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
I surfed the web but I'm still stuck; I believe my problem it's with the Windows Headers.
I looked here(
http://msdn.microsoft.com/en-us/libr...(v=VS.85).aspx ) but nothing..
I'm using Visual C++ 2010 Express and my OS is XP 32-bit.
// CODE Cardgame.h
#ifndef CARDGAME_H
#define CARDGAME_H
using namespace std;
#pragma once
class Cardgame
{
int players;
static int totalparticipants;
public:
Cardgame(int p);
~Cardgame(void);
};
#endif
// CODE Cardgame.cpp:
#define NTDDI_WINXP 0x05010000
#define _WIN32_WINNT_WINXP 0x0501
#include "Cardgame.h"
#include <iostream>
using namespace std;
Cardgame::Cardgame(int p)
{
players = p;
totalparticipants += p;
cout << p << " players have started a new game. There are now "
<< totalparticipants << " players in total." << endl;
}
Cardgame::~Cardgame(void)
{
}
// CODE testgame.cpp:
#include <iostream>
#define NTDDI_WINXP 0x05010000
#define _WIN32_WINNT_WINXP 0x0501
#include "Cardgame.h"
int Cardgame::totalparticipants = 0;
int main()
{
Cardgame *bridge = 0;
Cardgame *blackjack = 0;
Cardgame *solitaire = 0;
Cardgame *poker = 0;
bridge = new Cardgame(4);
blackjack = new Cardgame(8);
solitaire = new Cardgame(1);
delete blackjack;
delete bridge;
poker = new Cardgame(5);
delete solitaire;
delete poker;
return 0;
}
Any help that you can provide will be appreciated.
Thanks