⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 errors.txt

📁 为SSD5课程《数据结构与算法》中的练习
💻 TXT
字号:
Bug #1
-----------------------------
Line
"void build_wordlist (string* word_list, int capacity, string filename)"
    must be changed to
"void build_wordlist (string*& word_list, int& capacity, string filename)"
    because
fuction build_wordlist should read words into word_list,so word_list and capacity should be passed by reference.

Bug #2
-----------------------------
Line
"new_word_list = word_list[index];"
    must be changed to 
"new_word_list[index] = word_list[index];"
    because
new_word_list is a pointer,the copy can be finished only if every memory location is changed to the correct assignment.

Bug #3
-----------------------------
Line
"string new_word_list = *(new string[2 * capacity]);" and "*word_list = new_word_list;"
    must be changed to
"string *new_word_list = new string[2 * capacity];" and "word_list = new_word_list;"
    because
we must store the address of the new list in the pointer new_word_list.

Bug #4
-----------------------------
Line
"delete word_list;
    must be changed to
"delete []word_list;"
    because 
deleting an array must be written like this "delete []'指向数组的指针';".








⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -