// blogListTest.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <stddef.h> #include <Windows.h> #include <iostream> using namespace std; //MFC中链表的实现 class CMySimpleList { public: CMySimpleList(int nNextOffset = 0); void Construct(int nNextOffset); BOOL IsEmpty(void) const; void AddHead(void* p); void RemoveAll(void); void* GetHead(void) const; void* GetNext(void* p) const; BOOL Remove(void* p); public: void* m_pHead; size_t m_nNextOffset; void** GetNextPtr(void* p) const; }; CMySimpleList::CMySimpleList(int nNextOffset) : m_nNextOffset(nNextOffset), m_pHead(NULL) { } void CMySimpleList::Construct(int nNextOffset) { m_nNextOffset = nNextOffset; } BOOL CMySimpleList::IsEmpty() const { return (NULL == m_pHead); } void CMySimpleList::AddHead(void* p) { *GetNextPtr(p) = m_pHead; m_pHead = p; } void* CMySimpleList::GetHead(void) const { r