I don’t know why you wrote this ridiculous code, but I assume you may want this:
class Player
{
public:
static int playerHP;
static int playerPWR;
};
int Player::playerHP = 100;
int Player::playerPWR = 4;
More Related Contents:
- Program telling me to initialize variable that does not need to be initialized when writing a simple c++ code
- Strcmp() function not working properly [closed]
- Can num++ be atomic for ‘int num’?
- What’s the difference between assignment operator and copy constructor?
- C++11 reverse range-based for-loop
- Overloading member access operators ->, .*
- How do I start a new CUDA project in Visual Studio 2008?
- Why is the C++ initializer_list behavior for std::vector and std::array different?
- Can I use C++11 with Xcode?
- Linker error when calling a C function from C++ code in different VS2010 project
- Qt signals (QueuedConnection and DirectConnection)
- I cannot pass lambda as std::function
- C++11 static_assert and template instantiation
- How to access private data members outside the class without making “friend”s? [duplicate]
- Excessive use of `this` in C++ [duplicate]
- Simple way to unzip a .zip file using zlib [duplicate]
- C++ template, linking error [duplicate]
- MinGW .exe requires a few gcc dll’s regardless of the code?
- 2D-array as argument to function
- Variadic Template in VS 2012 (Visual C++ November 2012 CTP)
- Print 2-D Array in clockwise expanding spiral from center
- multiple definition error c++
- Can I increment an iterator by just adding a number?
- library is linked but reference is undefined
- Pointer array and sizeof confusion
- Why the initializer of std::function has to be CopyConstructible?
- what does const mean in c++ in different places
- Which one will execute faster, if (flag==0) or if (0==flag)?
- Why is a segmentation fault not recoverable?
- When virtual inheritance IS a good design?