jeudi 5 mars 2015

Linkedlists and class naming in c++


I need help with linkedlists and the naming of the classes in them. So in the main(), the linkedlist is declared as:



TrainList list;


so I'm a bit confused at how to implement the linked list class to match the main (because it's usually declared as List list).


So would it be



class TrainList;

class ListNode {

//code

friend class TrainList
}

class TrainList {

//code

}


Would this be right?




Aucun commentaire:

Enregistrer un commentaire