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/library/aa383745(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;
Cardgame(int p);

// 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;

// 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 and thanks to Daniweb

I didn't get any warnings or errors when I compiled that code with vc++ 2010 Express. Check your code very carefully -- there might be an extraneous character somewhere.

AFAIK that compiler should work ok on XP.

thanks Ancient Dragon! :)
This article has been dead for over six months. Start a new discussion instead.