char 配列の途中にある何かへのポインターを返すにはどうすればよいですか?
// Returns a pointer to the first occurrence of the given character in the
// given string.
const char* strchr(const char* string, char charToFind) {
for (int i = 0; i < strlen(string); i++) {
if (string[i] == charToFind) {
return string[i]; // <== THIS IS WRONG, How do I fix this?
}
}
return '\0';
}