-
This don't look right
Is this a legal statment in C/C++? (look at the struct please)
Code:
// Player.h: interface for the CPlayer class.
//
#ifndef _PLAYER_H_
#define _PLAYER_H_
class CPlayer : public CBasePlayer
{
public:
CPlayer();
virtual ~CPlayer();
void Inventory();
int FirstWep();
int SeconWep();
private:
struct s_iInvent
{
char name[30];
int type;
int ammt;
};
s_iInvent[18];
};
#endif // _PLAYER_H_
-
nope
use
Code:
struct s_iInvent
{
char name[30];
int type;
int ammt;
};
struct s_iInvent varname[18];
or
Code:
typedef struct
{
char name[30];
int type;
int ammt;
}s_iInvent;
s_iInvent varname[18];
or
Code:
struct s_iInvent
{
char name[30];
int type;
int ammt;
}varname[18];
-
one more
This is the official way to do it, see latest ANSI C++ specification
(in C++, in C it's wrong)
Code:
...
s_iInvent varname[18];
-
oh!, thanks. My monitor must be broken.. hehe, thanks guys for the help!!