VC++编程100个实用实例源码

源代码在线查看: list.h

软件大小: 2578 K
上传用户: forchwei
关键词: 100 VC 编程 源码
下载地址: 免注册下载 普通下载 VIP

相关代码

				//THIS HEAD FILE ONLY DEFINES A "SINGLE DIRECTION LIST" CLASS
				//FILE LIST.H
				
				#include 
				
				class NODE
				{
					//FRIEND CLASS "LIST" CAN HAVE ACCESS TO THE CLASS "NODE" 'S PRIVATE PART
					friend class LIST;
					private :
							//NEXT NODE LINK
							NODE *NEXT;
							//THE CURRENT NODE DATA
							int DATA;
				};
				
				class LIST
				{
					private :
							//THE HEAD OF THE LIST
							NODE *HEAD;
					public :
							//CONSTRUCTOR FUNCTION
							LIST()
							{
								//INITIAL
								HEAD=0;
							}
							//ADD TO THE FRONT OF THE LIST
							void Build_Forward(int Data);
							//ADD TO THE BACK OF THE LIST
							void Build_Backward(int Data);
							//GET THE HEAD OF THE LIST
							NODE* GET_HEAD();
							//GET THE DATA OF THE LIST
							int LIST::GET_NEXT(NODE * &TEMP);
							//GET THE DATA IN THE GIVED POSITION
							int LIST::GET_POSITION(int P);
							//REMOVE ALL THE NODES IN THE LIST
							void CLEAR();
							~LIST()
							{
								CLEAR();
							}
				};			

相关资源