Click here to Skip to main content
16,016,184 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralConvert CString Long, cant, help? (Newbie) Pin
PocketBlast15-Feb-03 11:25
PocketBlast15-Feb-03 11:25 
GeneralRe: Convert CString Long, cant, help? (Newbie) Pin
Michael A. Barnhart15-Feb-03 11:36
Michael A. Barnhart15-Feb-03 11:36 
GeneralRe: Convert CString Long, cant, help? (Newbie) Pin
Michael Dunn15-Feb-03 11:53
sitebuilderMichael Dunn15-Feb-03 11:53 
QuestionParsing US date/time using COleDateTime ??? Pin
Anonymous15-Feb-03 10:36
Anonymous15-Feb-03 10:36 
AnswerRe: Parsing US date/time using COleDateTime ??? Pin
Abin15-Feb-03 14:04
Abin15-Feb-03 14:04 
GeneralRe: Parsing US date/time using COleDateTime ??? Pin
Anonymous15-Feb-03 23:41
Anonymous15-Feb-03 23:41 
GeneralCreating structure for XML data Pin
15-Feb-03 10:31
suss15-Feb-03 10:31 
GeneralLinked List HELP!. Pin
Sal R.15-Feb-03 8:55
Sal R.15-Feb-03 8:55 
I am trying to build a simple linked list and i keep getting the following error: "error C2146: syntax error : missing ';' before identifier 'server'"

here is my code and if anybody can figure it out PLEASE let me know.

#include <fstream>
#include <iostream>
#include <iomanip>
#include <list>


using namespace std;



class server // Actual Data the serverNodes will point to
{
private:
int S_ID;
int Speed;

public:
server(); //Contructor aka (
~server();
};

class request
{
private:
int R_ID;
int Arr_t;
int cpuT;
public:
request();
~request();
};


class serverNode
{
public:
server *entry; //pointer to server object (aka my data)
serverNode *next; //pointer to my next node
serverNode (server *);
~serverNode();
};


serverNode::serverNode( server *p)
{
entry = p;
next = NULL;
}



class LinkedList //list will be responsible for adding,removing etc.
{
private:
serverNode *front; // pointer to the front of my list
serverNode *rear; // pointer to the rear of my list
public:
LinkedList();
~LinkedList();
void insert( server *); //function will insert server data to rear of list
server* remove(void);
server* dis();
};

LinkedList::LinkedList(){front=rear=NULL;}
LinkedList::LinkedList()


server *Linkedlist::dis()
{
front->entry;
}




LinkedList::insert(server *item) //This fucntion will insert next data from the rear
if(rear != NULL)
{
rear->next= new serverNode (item);
rear= rear->next;
}
else
front=rear= new serverNode(item);

}


server *LinkedList::remove(void)
{
server *ret;
if(isEmpty()==false)
{
ret=front->entry;
servernode *tobe_removed = front;
front = front->next;
delete tobe_removed;
if(front==NULL) // if list is becoming an empty list
rear=NULL
}
return ret;
}


int main()
{
int user_in;


cout <<"Welcome to the Washington Heights server system where you network may or may not work\n";
cout << "How many servers you want us to attempt to work with?\n";
cin >> user_in;


return 0;
}
GeneralRe: Linked List HELP!. Pin
AlexO15-Feb-03 9:14
AlexO15-Feb-03 9:14 
GeneralLPSTREAM and CString Pin
Member 9615-Feb-03 8:52
Member 9615-Feb-03 8:52 
GeneralRe: LPSTREAM and CString Pin
AlexO15-Feb-03 9:09
AlexO15-Feb-03 9:09 
GeneralRe: LPSTREAM and CString Pin
peterchen15-Feb-03 10:25
peterchen15-Feb-03 10:25 
QuestionHow to Kill Fliker on CDialog? Pin
Michael_Russia15-Feb-03 7:52
sussMichael_Russia15-Feb-03 7:52 
QuestionUn-caught exception - how do I pin it down ? Pin
Still learning how to code15-Feb-03 7:45
Still learning how to code15-Feb-03 7:45 
AnswerRe: Un-caught exception - how do I pin it down ? Pin
Chris Losinger15-Feb-03 7:53
professionalChris Losinger15-Feb-03 7:53 
GeneralRe: Un-caught exception - how do I pin it down ? Pin
Still learning how to code16-Feb-03 8:09
Still learning how to code16-Feb-03 8:09 
GeneralRe: Un-caught exception - how do I pin it down ? Pin
Scott H. Settlemier17-Feb-03 18:10
Scott H. Settlemier17-Feb-03 18:10 
GeneralSetting the lenght of a text field in an SQL Access database... Pin
IrishSonic15-Feb-03 4:36
IrishSonic15-Feb-03 4:36 
GeneralRe: Setting the lenght of a text field in an SQL Access database... Pin
Anders Molin15-Feb-03 4:59
professionalAnders Molin15-Feb-03 4:59 
GeneralRe: Setting the lenght of a text field in an SQL Access database... Pin
Roger Wright15-Feb-03 6:18
professionalRoger Wright15-Feb-03 6:18 
GeneralRe: Setting the lenght of a text field in an SQL Access database... Pin
Member 9615-Feb-03 8:58
Member 9615-Feb-03 8:58 
GeneralRe: Setting the lenght of a text field in an SQL Access database... Pin
IrishSonic16-Feb-03 1:32
IrishSonic16-Feb-03 1:32 
QuestionHow can i send message from one view to the other ? Pin
muna_utkal15-Feb-03 2:08
muna_utkal15-Feb-03 2:08 
AnswerRe: How can i send message from one view to the other ? Pin
João Paulo Figueira15-Feb-03 5:31
professionalJoão Paulo Figueira15-Feb-03 5:31 
AnswerRe: How can i send message from one view to the other ? Pin
valikac15-Feb-03 6:56
valikac15-Feb-03 6: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.