不存在此类文件或目录
No Such File Or Directory Exists
我收到错误,不存在这样的文件或目录,这让我感到困惑。我不想帮助填写我的方法或我想为自己做的任何事情。我想修复此错误,以便我可以开始我的项目。
这是我得到的错误:我的错误
这是我发生错误的代码。如果您需要其他任何内容,我很乐意更新我的问题,或提供相关信息。感谢任何帮助的人
#ifndef _DLINKEDLIST_H_
#define _DLINKEDLIST_H_
#include <cstdlib>
#include <stdexcept>
#include <string>
using namespace std;
// template class for doubly-linked list node
template <class T>
class Node
{
public:
T data;
//string data;
Node<T>* prev;
Node<T>* next;
// default constructor
//template <class T>
Node(T value)
{
data = value;
prev = NULL;
next = NULL;
}
};
// DLinkedList class definition
template <class T>
class DLinkedList
{
private:
// DLinkedList private members
int size; // number of items stored in list
Node<T>* front; // references to the front
Node<T>* back; // and back of the list
// helper function for deep copy
// Used by copy constructor and operator=
void CopyList(const DLinkedList& ll);
// helper function for deep delete
// Used by destructor and copy/assignment
void DeleteList();
public:
// default constructor
DLinkedList();
// copy constructor, performs deep copy of list elements
DLinkedList(const DLinkedList& ll);
// destructor
~DLinkedList();
// MUTATORS
// Inserts an item at the front of the list
// POST: List contains item at position 0
// PARAM: item = item to be inserted
void InsertFront(T item);
// Inserts an item at the back of the list
// POST: List contains item at back
// PARAM: item = item to be inserted
void InsertBack(T item);
// Inserts an item in position p (0-indexed)
// Throws exception for invalid index
// PRE: 0 <= p <= size
// POST: List contains item at position p
// PARAM: item = item to be inserted, p = position where item will be inserted
void InsertAt(T item, int p);
// Removes and returns an item from position p (0-indexed)
// Throws exception if list is empty or index invalid
// PRE: 0 <= p < size
// POST: Item is removed from list
// PARAM: p = position from where item will be removed
T RemoveAt(int p);
// Removes duplicates from the list, preserving existing order of remaining items.
// The first occurrence of any duplicate (relative to the front of the list)
// is the one which remains.
// We have not yet learned about efficiency so you may implement this in any way
// as long as the resulting list satisfies the requirement above.
// PRE:
// POST: List contains no duplicates, front and back point to the appropriate nodes
// PARAM:
void RemoveDuplicates();
// ACCESSORS
// Returns size of list
int Size() const;
// Returns whether the list is empty
bool IsEmpty() const;
// Returns existence of item
bool Contains(T item) const;
// Returns item at index (0-indexed)
// Throws exception for invalid index
T ElementAt(int p) const;
// OVERLOADED OPERATORS
// overloaded assignment operator
// must work in the following cases:
// list2 = list1 -> general case
// list2 = list2 -> should do nothing
DLinkedList& operator=(const DLinkedList& ll);
};
#include "dlinkedlist.cpp"
#endif
答案是一个快速简便的#include "..srcdlinkedlist.cpp"
而不是#include "dlinkedlist.cpp"
相关文章:
- 如何将 pls 文件保存在 QMediaPlaylist 而不是 m3u 中
- CMake 生成的程序无法在 Windows 上链接:尝试链接到不存在的文件
- 在不存在的目录中打开文件,C 与 C++
- C++ Linux 可执行文件一直尝试使用不存在的库
- 从文本文件中读取时,即使不存在,也会找到额外的字符(例如"@")?
- 如果C 中不存在,如何创建文件夹
- 尝试使用 wxWidgets 从 zip 打开不存在的文件时无法捕获的异常
- 打开文件,如果不存在,则创建,确定是否创建
- ifstream不读取文件中存在的`0a`字节
- ifstream::is_open 返回 true,即使该位置不存在文件也是如此
- 复制文件时是否可以自动创建不存在的目录?
- 如何从C 中的HDF5文件中读取属性名称和数据集名称,在这里我不知道HDF5文件中存在什么属性
- 打开不存在的文件时如何使流构造函数失败?
- 如果文件中不存在qt5中的文件,如何原子创建该文件
- C++仅当文件不存在时才打开文件进行写入
- 如果文件不存在,ifstream 会创建文件
- WinAPI - 如果文件不存在,则创建.ini文件
- 即使输入文件不存在,也会继续创建输出文件?编辑****
- 如何仅在不创建文件的情况下创建文件'不存在
- 当INI文件不存在时,使用Boost属性树读取INI文件