nullptr is a feature introduced in c++11, see: What exactly is nullptr?. You'll need a compiler that supports at least some features of c++11.
Can't return nullpointer in Cpp function [closed]
-
01-07-2022 - |
문제
I am not able to return the nullptr at the end of this method? Is there some kind of library I need to import?
const char* strstr(const char* string1, const char* string2) {
// TODO:
for (int i = 0; i < strlen(string1); i++) {
for (int j = 0; j < strlen(string2); j++) {
if (string1[i] == string2[i]) {
return &string1[i];
}
}
}
return nullptr;
}
해결책
제휴하지 않습니다 StackOverflow