关于#include using namespace std; 的新发现
在代码
#include <stdlib.h>
#include<stdio.h>
#define MaxSize 40
int next[MaxSize];
void GetNext(SqString t){
int j, k;
j = 0; k = -1; next[0] = -1;
while (j<t.len - 1) {
if (k == -1) {
j++; k++;
next[j] = k;
}
else if (t.data[j] == t.data[k]){
j++; k++;
next[j] = k;
}
else
k = next[k];
}
}
若将第二行改为include using namespace std;
会产生 C2872 的错误,提示next 不明确
– 未找到原因