foo.cc: In constructor 'Array::Array()':
foo.cc:20:35: error: 'NULL' was not declared in this scope
20 | this->arrayHead = NULL;
| ^~~~
foo.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
+++ |+#include <cstddef>
1 | // Test.cpp : 定义控制台应用程序的入口点。
foo.cc: In constructor 'Array::Array(int*, int)':
foo.cc:26:40: error: 'NULL' was not declared in this scope
26 | DataUnit *ptrNewUnit = NULL, *ptrPriorUnit = NULL;
| ^~~~
foo.cc:26:40: note: 'NULL' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
foo.cc:35:33: error: 'ptrPriorUnit' was not declared in this scope
35 | ptrPriorUnit = ptrNewUnit;
| ^~~~~~~~~~~~
foo.cc:39:33: error: 'ptrPriorUnit' was not declared in this scope
39 | ptrPriorUnit->next = ptrNewUnit;
| ^~~~~~~~~~~~
foo.cc: In member function 'bool Array::DeleteByIndex(int)':
foo.cc:55:52: error: 'NULL' was not declared in this scope
55 | DataUnit *ptrCurrentUnit = NULL, *ptrPriorUnit = NULL;
| ^~~~
foo.cc:55:52: note: 'NULL' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
foo.cc:59:33: error: 'ptrPriorUnit' was not declared in this scope
59 | ptrPriorUnit = ptrCurrentUnit;
| ^~~~~~~~~~~~
foo.cc:62:29: error: 'ptrPriorUnit' was not declared in this scope
62 | if (ptrPriorUnit == NULL)
| ^~~~~~~~~~~~
foo.cc: In member function 'void Array::Display()':
foo.cc:86:44: error: 'NULL' was not declared in this scope
86 | DataUnit *ptrCurrentUnit = NULL;
| ^~~~
foo.cc:86:44: note: 'NULL' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
foo.cc:90:25: error: 'cout' was not declared in this scope
90 | cout << ptrCurrentUnit->data << " ";
| ^~~~
foo.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
+++ |+#include <iostream>
1 | // Test.cpp : 定义控制台应用程序的入口点。
foo.cc:93:17: error: 'cout' was not declared in this scope
93 | cout << endl;
| ^~~~
foo.cc:93:17: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
foo.cc:93:25: error: 'endl' was not declared in this scope
93 | cout << endl;
| ^~~~
foo.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; did you forget to '#include <ostream>'?
+++ |+#include <ostream>
1 | // Test.cpp : 定义控制台应用程序的入口点。
foo.cc: In function 'int main(int, char**)':
foo.cc:101:9: error: 'cin' was not declared in this scope
101 | cin >> nSize;
| ^~~
foo.cc:101:9: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
foo.cc: In member function 'bool Array::DeleteByIndex(int)':
foo.cc:83:9: warning: control reaches end of non-void function [-Wreturn-type]
83 | }
| ^
[Hydro](https://hydro.ac)提供评测服务