I am getting this error message
error: expected primary-expression before 'enum'
I can't figure it out.

#ifndef ROCK_H
#define ROCK_H
enum RockName {BASALT, DOLOMITE, GRANITE, GYPSUM, LIMESTONE, MARBLE, OBSIDIAN,
	QUARZITE, SANDSTONE, SHALE, ROCK_OVERFLOW};

class Rock
{
	public:
	Rock()
	{myName = BASALT;}
	Rock(enum RockName)
	{myName= RockName;}//here is where I am getting the error


	private:
	RockName myName;
};
#endif

>>Rock(enum RockName)
You want :

Rock(RockName rockName){ myName = rockName; }
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.