这是表示的是一个编程语句,所以的话应该是先运行第1个单词,然后运行完成的话,那么就可以运行第4个了。
1. elemtype不是名称,而是类型。比如int,char, 或者是自定义的结构体或类 2. 若并非动态分配的(new、malloc)则可通过sizeof(list)/sizeof(elemtype)获得数量。但请注意用在这里并不合适,因为作为函数参数的数组会退化为指针,所以在32位机上sizeof(list) = 4。所以要明确数值,否则就会出错。
改写这个代码#include #define ERROR 0 #define DEFAULT_CAPACITY 100 using namespace std; template class Vector { protected: int length, capacity; ElemType* elem; void expand() { if (length < capacity)... #include#define ERROR 0 #define DEFAULT_CAPACITY 100 using namespace std; templateclass ...