Click here to Skip to main content
16,007,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralOPENGL EXAMPLE TO DISPLAY JAPANESE/CHIENSE Pin
sdfdsfa23-Sep-03 10:39
sdfdsfa23-Sep-03 10:39 
GeneralList Exchange Servers Pin
Robert M Greene23-Sep-03 10:37
Robert M Greene23-Sep-03 10:37 
Generaldouble problem Pin
Sirrius23-Sep-03 10:32
Sirrius23-Sep-03 10:32 
GeneralRe: double problem Pin
Joaquín M López Muñoz23-Sep-03 11:04
Joaquín M López Muñoz23-Sep-03 11:04 
GeneralRe: double problem Pin
Sirrius23-Sep-03 13:18
Sirrius23-Sep-03 13:18 
GeneralRe: double problem Pin
David Crow23-Sep-03 16:58
David Crow23-Sep-03 16:58 
GeneralRe: double problem Pin
Sirrius23-Sep-03 18:19
Sirrius23-Sep-03 18:19 
GeneralOrdered Linked List Pin
Sirrius23-Sep-03 10:01
Sirrius23-Sep-03 10:01 
I have a list class here that is being handed a tree class(not included in the thread). I need to get this List to be ordered and have been having a devil of a time doing so.
It seems not to like anything I throw at it; bool operators to decide less than or greater than, if statements. Can sombody give me a push in the right direction.
Thanks.
B.

#include <iostream>
#include <string>

#ifndef LIST_H
#define LIST_H

using namespace std;

struct node
{
	string data;
	node *next;
	node *successor;
	node *predec;
};




//Linked List class
class List
{
	node *first;
	node *successor;
	node *predec;
	
	//friend class treeNode;
	
public:

	List()
	{
		first=NULL;
		successor=NULL;
		predec=NULL;
	}
void insertNode(string newName)
	{
		node *p;
		p=new node;
		p->data=newName;
		p->next=first;
		first=p;
		
		}

	
	void outputList(ostream &out)
	{
		
		node *p;
		p=first;

		if(!empty())
		{
			cout << endl;
			while(p!=NULL)
			{
				
				cout << p->data << " ";
				p=p->next;
			}
		}
		else 
			cout << "The list is empty!" << endl;
	}
	

	bool empty()
	{
		if(first==NULL)
			return true;
		else
			return false;
	}
	




};

#endif

GeneralRe: Ordered Linked List Pin
Joaquín M López Muñoz23-Sep-03 11:00
Joaquín M López Muñoz23-Sep-03 11:00 
GeneralRe: Ordered Linked List Pin
David Crow23-Sep-03 11:20
David Crow23-Sep-03 11:20 
GeneralRe: Ordered Linked List Pin
Sirrius23-Sep-03 13:20
Sirrius23-Sep-03 13:20 
GeneralRC2 encryption interoperability between VC++ and VB.NET Pin
sheelag23-Sep-03 8:49
sheelag23-Sep-03 8:49 
GeneralCDaoDatabase and CDaoRecordset for MS Access 2000 Pin
DionChen23-Sep-03 8:00
DionChen23-Sep-03 8:00 
GeneralRe: CDaoDatabase and CDaoRecordset for MS Access 2000 Pin
JWood23-Sep-03 9:57
JWood23-Sep-03 9:57 
GeneralRe: CDaoDatabase and CDaoRecordset for MS Access 2000 Pin
RChin23-Sep-03 10:14
RChin23-Sep-03 10:14 
Generalcreating menus in VC++ dialog application Pin
karteek23-Sep-03 7:39
karteek23-Sep-03 7:39 
GeneralRe: creating menus in VC++ dialog application Pin
David Crow23-Sep-03 8:55
David Crow23-Sep-03 8:55 
QuestionGetClientRect with initial window wrong? Pin
Harco23-Sep-03 6:42
Harco23-Sep-03 6:42 
AnswerRe: GetClientRect with initial window wrong? Pin
cje23-Sep-03 9:00
cje23-Sep-03 9:00 
GeneralMFC ODBC Consumer Wizard Crashes Pin
Matt Gates23-Sep-03 6:22
Matt Gates23-Sep-03 6:22 
General[Message Deleted] Pin
imdx8023-Sep-03 6:05
imdx8023-Sep-03 6:05 
GeneralRe: Iterating Connection Names, Pin
Mike Dimmick23-Sep-03 7:32
Mike Dimmick23-Sep-03 7:32 
Generalwin95 global memory Pin
umarcool23-Sep-03 5:24
umarcool23-Sep-03 5:24 
Generalmenu Pin
sardinka23-Sep-03 4:31
sardinka23-Sep-03 4:31 
GeneralRe: menu Pin
RobJones23-Sep-03 4:56
RobJones23-Sep-03 4:56 

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.