Good Morning
09:26 am

Sponsor Area

Sponsor Area

Question is

Write the definition of a member function PUSHGIFT() for a class STACK in C++,to add a GIFT in a dynamically allocated stack of GIFTs considering the following code is already written as a part of the program:

struct GIFT
{
	int GCODE;       //Gift Code
	char GDESC[20]; //Gift Description
	GIFT *Link;
};
class STACK
{
	Gift *TOP;
public:
	STACK(){
		TOP=NULL;
	}
	void PUSHGIFT();
	void POPGIFT();
	~STACK();
};

Mock Test Series

Sponsor Area

Sponsor Area

NCERT Book Store

NCERT Sample Papers

Entrance Exams Preparation