set static member pointer variables

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2010-04-12T23:45:55Z Indexed on 2010/04/12 23:53 UTC
Read the original article Hit count: 328

I'm trying to set a static pointer variable in a class but I'm getting these errors for each variable I try to set.

error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

error C2040: 'xscroll' : 'int' differs in levels of indirection from 'float *'

error C2440: 'initializing' : cannot convert from 'float **' to 'int'

Here is the code Enemy.h

#include <windows.h>
#include "Player.h"

class Enemy
{
public:
Enemy(float xPos, float yPos);
Enemy(void);
~Enemy(void);

//update the position of the user controlled object.
void updatePosition(float timeFactor);

//loads all the enemy textures
void static loadTextures();

//creates a set number of enemies
void static createEnemies(int numEnemies, Enemy * enemyArray);

GLuint static enemyTex;
static float * xscroll;
static float * yscroll;
static Player * player;

private:
bool checkCollison(float x, float y, int radius);

float XPos;
float YPos;

};

trying to set variables

Enemy::xscroll = &xscroll;
Enemy::yscroll = &yscroll;
Enemy::player = &player;

© Stack Overflow or respective owner

Related posts about c++

Related posts about class-variables