#include "Q1-VerifyUniqueCharInString.h"
#include <cstring>
#include <stdio.h>
#include <string.h>
using namespace std;
bool isUniqueChar(string str)
{
int length=strlen(str),i=0;
bool tab[] = new bool[length];
if (length > 0xff) {
return false;
}
for (; i<length;++i) {
if (str[i]) {
return false;
}
tab[str[i]]=true;
}
return true;
}
これは私のコードであり、gcc + xcodeを使用しています....strlenが見つからないと常に言われるのはなぜですか、cstringとstring.hの両方を使用しています...