Click here to Skip to main content
16,011,804 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to delete an HBITMAP? Pin
Paul M Watt18-Dec-02 9:51
mentorPaul M Watt18-Dec-02 9:51 
GeneralRe: How to delete an HBITMAP? Pin
Joan M18-Dec-02 9:59
professionalJoan M18-Dec-02 9:59 
GeneralWeird Case Pin
Sidney18-Dec-02 9:34
Sidney18-Dec-02 9:34 
GeneralRe: Weird Case Pin
Chris Richardson18-Dec-02 10:31
Chris Richardson18-Dec-02 10:31 
GeneralRe: Weird Case Pin
Sidney18-Dec-02 10:57
Sidney18-Dec-02 10:57 
GeneralRe: Weird Case Pin
Chris Richardson19-Dec-02 20:32
Chris Richardson19-Dec-02 20:32 
GeneralMFC Grid - How To Tab Out of... Pin
RFID Chris18-Dec-02 9:14
RFID Chris18-Dec-02 9:14 
GeneralReverse link list test Pin
Todd Smith18-Dec-02 8:49
Todd Smith18-Dec-02 8:49 
Here's what I came up with for the above problem. Is there a more efficient or nicer way to solve this problem?

typedef struct _List
{
	int data;
	_List* pNext;

	_List(int d) : data(d), pNext(0) {}
	
} List;

int main(int argc, char* argv[])
{
	List* pList = new List(0);
	List* pTemp = pList;

	for (int i = 1; i < 10; i++)
	{
		pTemp->pNext = new List(i);
		pTemp = pTemp->pNext;
	}

	pTemp = pList;
	while (pTemp)
	{
		DEBUGF("%i", pTemp->data);

		pTemp = pTemp->pNext;
	}

	DEBUGF("reversing...");

	List* p1 = pList;
	List* p2 = pList->pNext;
	p1->pNext = 0;
	while (p2)
	{
		List* p3 = p2->pNext;
		p2->pNext = p1;
		p1 = p2;
		p2 = p3;
	}
	pList = p1;

	pTemp = pList;
	while (pTemp)
	{
		DEBUGF("%i", pTemp->data);

		pTemp = pTemp->pNext;
	}

	return 0;
}


Todd Smith
GeneralRe: Reverse link list test Pin
Tim Smith18-Dec-02 9:12
Tim Smith18-Dec-02 9:12 
QuestionDlls dialogs in FormViews? Pin
Ricky_TheBard18-Dec-02 8:27
Ricky_TheBard18-Dec-02 8:27 
QuestionFunctions to manage user profiles in a server ? Pin
Cris18-Dec-02 8:22
Cris18-Dec-02 8:22 
QuestionFlexible deriving a CAsyncSocket class? Pin
User 665818-Dec-02 7:56
User 665818-Dec-02 7:56 
Generalxlocale & xlocnum produce warnings at level 4 Pin
scott sanders18-Dec-02 6:01
scott sanders18-Dec-02 6:01 
GeneralRe: xlocale & xlocnum produce warnings at level 4 Pin
scott sanders18-Dec-02 10:25
scott sanders18-Dec-02 10:25 
GeneralXML filter for Indexing services Pin
Lucian MATEESCU18-Dec-02 5:29
Lucian MATEESCU18-Dec-02 5:29 
GeneralZooming a CDC Pin
S O S18-Dec-02 4:51
S O S18-Dec-02 4:51 
GeneralRe: Zooming a CDC Pin
Chris Losinger18-Dec-02 8:02
professionalChris Losinger18-Dec-02 8:02 
Generaldll question Pin
salah_gis18-Dec-02 4:48
salah_gis18-Dec-02 4:48 
GeneralOpening a socket Pin
Trin218-Dec-02 4:31
Trin218-Dec-02 4:31 
GeneralRe: Opening a socket Pin
-Dy18-Dec-02 22:46
-Dy18-Dec-02 22:46 
GeneralRe: process problem Pin
jmkhael18-Dec-02 4:31
jmkhael18-Dec-02 4:31 
GeneralBuilding MFC extension problem Pin
Wenrich18-Dec-02 3:56
Wenrich18-Dec-02 3:56 
GeneralProblem to make call in TAPI ( 2.2 ) Pin
S.Maharajan18-Dec-02 3:25
S.Maharajan18-Dec-02 3:25 
GeneralRe: Problem to make call in TAPI ( 2.2 ) Pin
Michael P Butler18-Dec-02 4:40
Michael P Butler18-Dec-02 4:40 
GeneralA simple C compiler Pin
ns18-Dec-02 3:03
ns18-Dec-02 3:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.