ListNode.h ...
friend class Lis[COLOR="Red"]t<[/COLOR]NODETYPE>;
связный список visual studio
List.h
Цитата:
#ifndef LIST_H
#define LIST_H
#include "iostream.h"
#include "assert.h"
#include "ListNode.h"
using namespace std;
template <class NODETYPE>
class List{
public:
List() ;
~List();
void insertAtFront(const NODETYPE &);
void insertAtBack(const NODETYPE &);
int removeFromFront(NODETYPE &);
int removeFromBack(NODETYPE &);
int isEmpty() const;
void print() const;
private:
ListNode<NODETYPE> *firstPtr;
ListNode<NODETYPE> *lastPtr;
ListNode<NODETYPE> *getNewNode(const NODETYPE &);
};
template<class NODETYPE>
List<NODETYPE>::List(){firstPtr=lastPtr=0;}
template<class NODETYPE> List<NODETYPE>::~List()
{
if(!isEmpty()){
cout<<"Удаление узлов ..."<<endl;
ListNode<NODETYPE>*currentPtr=firstPtr,*tempPtr;
while (currentPtr!=0){
tempPtr=currentPtr;
cout<<tempPtr->data<<endl;
currentPtr=currentPtr->nextPtr;
delete tempPtr;
}
}
cout<<"Все узлы удалены"<<endl<<endl;
}
template<class NODETYPE>
void List<NODETYPE>::insertAtBack(const NODETYPE &value)
{
ListNode<NODETYPE> *newPtr=getNewNode(value);
if (isEmpty())
firstPtr=lastPtr=newPtr;
else{
lastPtr->nextPtr=newPtr;
lastPtr=newPtr;
}
}
template<class NODETYPE>
int List<NODETYPE>::removeFromFront(NODETYPE &value)
{
if(isEmpty())
return 0;
else {
ListNode<NODETYPE>*tempPtr=firstPtr;
if (firstPtr==lastPtr)
firstPtr=lastPtr=0;
else
firstPtr=firstPtr->nextPtr;
value=tempPtr->data;
delete tempPtr;
return 1;
}
}
template<class NODETYPE>
int List<NODETYPE>::removeFromBack(NODETYPE &value)
{
if (isEmpty())
return 0;
else{
ListNode<NODETYPE>*tempPtr=firstPtr;
if (firstPtr==lastPtr)
firstPtr=lastPtr=0;
else
firstPtr=firstPtr->nextPtr;
value=tempPtr->data;
delete tempPtr;
return ;
}
}
template <class NODETYPE>
int List<NODETYPE>::removeFromBack(NODETYPE &value)
{
if (isEmpty())
return 0;
else{
ListNode<NODETYPE>*tempPtr=lastPtr;
if (firstPtr==lastPtr)
firstPtr=lastPtr=0;
else{
ListNode<NODETYPE>*currentPtr=firstPtr;
while (currentPtr->nextPtr!=lastPtr)
currentPtr=currentPtr->nextPtr;
lastPtr=currentPtr;
currentPtr->nextPtr=0;
}
value=tempPtr->data;
delete tempPtr;
return 1;
}
}
template<class NODETYPE>
int List<NODETYPE>::isEmpty() const {return first==0;}
template<class NODETYPE>
{
ListNode<NODETYPE> *List<NODETYPE>::getNewNode(const NODETYPE &value);
assert(ptr!=0);
return ptr;
}
template<class NODETYPE>
void List<NODETYPE>:: print() const
{
if(isEmpty()){
cout<<"Список пуст"<<endl<<endl;
return;
}
ListNode<NODETYPE>*currentPtr=firstPtr;
cout<<"Список состоит из: ";
while (currentPtr!=0){
cout<<currentPtr->data<<' ';
currentPtr=currentPtr->nextPtr;
}
cout<<endl<<endl;
}
#endif
#define LIST_H
#include "iostream.h"
#include "assert.h"
#include "ListNode.h"
using namespace std;
template <class NODETYPE>
class List{
public:
List() ;
~List();
void insertAtFront(const NODETYPE &);
void insertAtBack(const NODETYPE &);
int removeFromFront(NODETYPE &);
int removeFromBack(NODETYPE &);
int isEmpty() const;
void print() const;
private:
ListNode<NODETYPE> *firstPtr;
ListNode<NODETYPE> *lastPtr;
ListNode<NODETYPE> *getNewNode(const NODETYPE &);
};
template<class NODETYPE>
List<NODETYPE>::List(){firstPtr=lastPtr=0;}
template<class NODETYPE> List<NODETYPE>::~List()
{
if(!isEmpty()){
cout<<"Удаление узлов ..."<<endl;
ListNode<NODETYPE>*currentPtr=firstPtr,*tempPtr;
while (currentPtr!=0){
tempPtr=currentPtr;
cout<<tempPtr->data<<endl;
currentPtr=currentPtr->nextPtr;
delete tempPtr;
}
}
cout<<"Все узлы удалены"<<endl<<endl;
}
template<class NODETYPE>
void List<NODETYPE>::insertAtBack(const NODETYPE &value)
{
ListNode<NODETYPE> *newPtr=getNewNode(value);
if (isEmpty())
firstPtr=lastPtr=newPtr;
else{
lastPtr->nextPtr=newPtr;
lastPtr=newPtr;
}
}
template<class NODETYPE>
int List<NODETYPE>::removeFromFront(NODETYPE &value)
{
if(isEmpty())
return 0;
else {
ListNode<NODETYPE>*tempPtr=firstPtr;
if (firstPtr==lastPtr)
firstPtr=lastPtr=0;
else
firstPtr=firstPtr->nextPtr;
value=tempPtr->data;
delete tempPtr;
return 1;
}
}
template<class NODETYPE>
int List<NODETYPE>::removeFromBack(NODETYPE &value)
{
if (isEmpty())
return 0;
else{
ListNode<NODETYPE>*tempPtr=firstPtr;
if (firstPtr==lastPtr)
firstPtr=lastPtr=0;
else
firstPtr=firstPtr->nextPtr;
value=tempPtr->data;
delete tempPtr;
return ;
}
}
template <class NODETYPE>
int List<NODETYPE>::removeFromBack(NODETYPE &value)
{
if (isEmpty())
return 0;
else{
ListNode<NODETYPE>*tempPtr=lastPtr;
if (firstPtr==lastPtr)
firstPtr=lastPtr=0;
else{
ListNode<NODETYPE>*currentPtr=firstPtr;
while (currentPtr->nextPtr!=lastPtr)
currentPtr=currentPtr->nextPtr;
lastPtr=currentPtr;
currentPtr->nextPtr=0;
}
value=tempPtr->data;
delete tempPtr;
return 1;
}
}
template<class NODETYPE>
int List<NODETYPE>::isEmpty() const {return first==0;}
template<class NODETYPE>
{
ListNode<NODETYPE> *List<NODETYPE>::getNewNode(const NODETYPE &value);
assert(ptr!=0);
return ptr;
}
template<class NODETYPE>
void List<NODETYPE>:: print() const
{
if(isEmpty()){
cout<<"Список пуст"<<endl<<endl;
return;
}
ListNode<NODETYPE>*currentPtr=firstPtr;
cout<<"Список состоит из: ";
while (currentPtr!=0){
cout<<currentPtr->data<<' ';
currentPtr=currentPtr->nextPtr;
}
cout<<endl<<endl;
}
#endif
ListNode.h
Цитата:
#ifndef LISTNODE_H
#define LISTNODE_H
template<class NODETYPE>
class ListNode{
friend class List <NODETYPE>;
public:
ListNode(const NODETYPE &);
NODETYPE getData() const;
private:
NODETYPE data;
ListNode *nextPtr;
};
template<class NODETYPE>
ListNode<NODETYPE>::ListNode(const NODETYPE &info)
{
data=info;
nextPtr=0;
}
template<class NODETYPE>
NODETYPE ListNode<NODETYPE>::getData() const {return data;}
#endif
#define LISTNODE_H
template<class NODETYPE>
class ListNode{
friend class List <NODETYPE>;
public:
ListNode(const NODETYPE &);
NODETYPE getData() const;
private:
NODETYPE data;
ListNode *nextPtr;
};
template<class NODETYPE>
ListNode<NODETYPE>::ListNode(const NODETYPE &info)
{
data=info;
nextPtr=0;
}
template<class NODETYPE>
NODETYPE ListNode<NODETYPE>::getData() const {return data;}
#endif
prog.cpp
Цитата:
#include "iostream.h"
#include "List.h"
using namespace std;
void testIntegerList();
void testFloatList();
void instructions();
main()
{
testIntegerList();
//testFloatList();
return 0;
}
void testIntegerList()
{
cout<<"Проверка списка целых чисел"<<endl;
List<int>integerList;
instructions();
int choice,value;
do{
cout<<"? ";
cin>>choice;
switch(choice){
case 1:
cout<<"Введите целое: ";
cin>>value;
integerList.insetAtFront(value);
integerList.print();
break;
case 2:
cout<<"Введите целое: ";
cin>>value;
integerList.insertAtBack(value);
integerList.print();
break;
case 3:
if (integerList.removeFromFront(value))
cout<<value<<" удаляеться из списка "<<endl;
integerList.print();
break;
}
}while (choice!=5);
cout<<"Конец проверки списка целых чисел"<<endl;
}
#include "List.h"
using namespace std;
void testIntegerList();
void testFloatList();
void instructions();
main()
{
testIntegerList();
//testFloatList();
return 0;
}
void testIntegerList()
{
cout<<"Проверка списка целых чисел"<<endl;
List<int>integerList;
instructions();
int choice,value;
do{
cout<<"? ";
cin>>choice;
switch(choice){
case 1:
cout<<"Введите целое: ";
cin>>value;
integerList.insetAtFront(value);
integerList.print();
break;
case 2:
cout<<"Введите целое: ";
cin>>value;
integerList.insertAtBack(value);
integerList.print();
break;
case 3:
if (integerList.removeFromFront(value))
cout<<value<<" удаляеться из списка "<<endl;
integerList.print();
break;
}
}while (choice!=5);
cout<<"Конец проверки списка целых чисел"<<endl;
}
Список ошибок:
Цитата:
------ Build started: Project: project_list, Configuration: Debug Win32 ------
Compiling...
prog.cpp
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(5) : error C2059: syntax error : '<'
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(12) : see reference to class template instantiation 'ListNode<NODETYPE>' being compiled
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(5) : error C2238: unexpected token(s) preceding ';'
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(22) : error C2989: 'List' : class template has already been declared as a non-class template
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(5) : see declaration of 'List'
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(7) : error C3857: 'List': multiple template parameter lists are not allowed
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(25) : error C2988: unrecognizable template declaration/definition
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(25) : error C2059: syntax error : '<'
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(27) : error C2588: '::~List' : illegal global destructor
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(27) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Build log was saved at "file://c:\Documents and Settings\рубо\Мои документы\Visual Studio 2008\Projects\project_list\project_list\Debug\BuildLog.htm"
project_list - 8 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Код:
#include "iostream.h" ==>> #include <iostream>
Цитата:
fatal error C1083: Cannot open include file: 'iostream': No such file or directory
Цитата: Proger_XP
Уверены, что тут нужен пробел?
Код:
ListNode.h ...
friend class Lis[COLOR="Red"]t<[/COLOR]NODETYPE>;
friend class Lis[COLOR="Red"]t<[/COLOR]NODETYPE>;
без пробела выдает такие же ошибки.
А это что?
Код:
template<class NODETYPE>
{
ListNode<NODETYPE> *List<NODETYPE>::getNewNode(const NODETYPE &value);
assert(ptr!=0);
return ptr;
}
{
ListNode<NODETYPE> *List<NODETYPE>::getNewNode(const NODETYPE &value);
assert(ptr!=0);
return ptr;
}
И можно как нибудь выравнивание внутри фигурных скобок сделать? Читать невозможно.
Я так понимаю, код вручную перепечатан из книги? Обычно к книгам по программированию можно скачать исходники. Может к твоей книге они тоже есть?
В исходном варианте она выглядела так.
Цитата:
template<class NODETYPE>
ListNode<NODETYPE> *List<NODETYPE>::getNewNode(const NODETYPE &value);
{
ListNode<NODETYPE>*ptr=new ListNode<NODETYPE>[value];
assert(ptr!=0);
return ptr;
}
Но все те же ошибки остались.Программа взята из книги Харви Дейтел, Пол Дейтел
"как программировать на с++".У меня электронная версия.Но вроде бы
диска с исходниками нет.
А как он в ListNode.h знает что такое List ?
Код:
template<class NODETYPE>
ListNode<NODETYPE> *List<NODETYPE>::getNewNode(const NODETYPE &value);
{
ListNode<NODETYPE>*ptr=new ListNode<NODETYPE>[value];
assert(ptr!=0);
return ptr;
}
ListNode<NODETYPE> *List<NODETYPE>::getNewNode(const NODETYPE &value);
{
ListNode<NODETYPE>*ptr=new ListNode<NODETYPE>[value];
assert(ptr!=0);
return ptr;
}
Функция insertAtFront не описана.
В этом коде в выражении сравнения есть переменная first, а ее нет в членах класса, наверно должен быть firstPtr:
Код:
template<class NODETYPE>
int List<NODETYPE>::isEmpty() const {return first==0;}
int List<NODETYPE>::isEmpty() const {return first==0;}
Вообще очень много ошибок. Думаю в книге они отсутствуют. Сверь с книгой каждую строчку кода.
Цитата: Phodopus
А как он в ListNode.h знает что такое List ?
уже осознал )
перед объявлением friend-а необходимо объявить класс как шаблонный:
Код:
template<typename NODETYPE>
class List;
class List;
ну и исправить кучу ошибок...
Теперь компилятор выдает вот это.
Цитата:
Compiling...
prog.cpp
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(34) : error C2248: 'ListNode<NODETYPE>::data' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(12) : see declaration of 'ListNode<NODETYPE>::data'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(28) : while compiling class template member function 'List<NODETYPE>::~List(void)'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\prog.cpp(15) : see reference to class template instantiation 'List<NODETYPE>' being compiled
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(35) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(49) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(44) : while compiling class template member function 'void List<NODETYPE>::insertAtFront(const NODETYPE &)'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(60) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(55) : while compiling class template member function 'void List<NODETYPE>::insertAtBack(const NODETYPE &)'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(74) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(66) : while compiling class template member function 'int List<NODETYPE>::removeFromFront(NODETYPE &)'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(75) : error C2248: 'ListNode<NODETYPE>::data' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(12) : see declaration of 'ListNode<NODETYPE>::data'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(92) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(83) : while compiling class template member function 'int List<NODETYPE>::removeFromBack(NODETYPE &)'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(93) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(95) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(97) : error C2248: 'ListNode<NODETYPE>::data' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(12) : see declaration of 'ListNode<NODETYPE>::data'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(127) : error C2248: 'ListNode<NODETYPE>::data' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(12) : see declaration of 'ListNode<NODETYPE>::data'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(119) : while compiling class template member function 'void List<NODETYPE>:: print(void) const'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(128) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
prog.cpp
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(34) : error C2248: 'ListNode<NODETYPE>::data' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(12) : see declaration of 'ListNode<NODETYPE>::data'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(28) : while compiling class template member function 'List<NODETYPE>::~List(void)'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\prog.cpp(15) : see reference to class template instantiation 'List<NODETYPE>' being compiled
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(35) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(49) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(44) : while compiling class template member function 'void List<NODETYPE>::insertAtFront(const NODETYPE &)'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(60) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(55) : while compiling class template member function 'void List<NODETYPE>::insertAtBack(const NODETYPE &)'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(74) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(66) : while compiling class template member function 'int List<NODETYPE>::removeFromFront(NODETYPE &)'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(75) : error C2248: 'ListNode<NODETYPE>::data' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(12) : see declaration of 'ListNode<NODETYPE>::data'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(92) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(83) : while compiling class template member function 'int List<NODETYPE>::removeFromBack(NODETYPE &)'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(93) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(95) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(97) : error C2248: 'ListNode<NODETYPE>::data' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(12) : see declaration of 'ListNode<NODETYPE>::data'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(127) : error C2248: 'ListNode<NODETYPE>::data' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(12) : see declaration of 'ListNode<NODETYPE>::data'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(119) : while compiling class template member function 'void List<NODETYPE>:: print(void) const'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\list.h(128) : error C2248: 'ListNode<NODETYPE>::nextPtr' : cannot access private member declared in class 'ListNode<NODETYPE>'
with
[
NODETYPE=int
]
c:\documents and settings\рубо\мои документы\visual studio 2008\projects\project_list\project_list\listnode.h(13) : see declaration of 'ListNode<NODETYPE>::nextPtr'
with
[
NODETYPE=int
]
Не пойму, тебе текст ошибок перевести надо?