Hi everyone,
First, i'm very new in c++ and also in this forum.
I'm using static data memers in my class and get this error: "missing storage-class or type specifiers". why is it so?
Thx for any help.

this is my code:

'================Class_FHF.h==============='
#ifndef Class_FHF
#define Class_FHF
#include <iostream>
#include "TempFHF.h"
using namespace std;

class FHF: public TempFHF
{
public:
	 FHF(int priority);
	~FHF();
private:
	int m_priority;
	static int m_id;	
};

#endif //Class_FHF

'===========Class_FHF.cpp================'

#include <iostream>
#include "Class_FHF.h"


FHF::m_id = 0;

FHF::FHF(int priority)
{
	m_priority = priority;
	
}

line 36 in your post should be int FHF::m_id = 0; You have to declare it with a data type just like you would any other global variable.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.