Generation

code to explanationMon, 03 Apr 2023

bool strfind(const char* s, char c, size_t* pos) { const char* foundp = strchr(s, c); if (foundp) { if (pos) { *pos = (foundp - s); } return true; } return false; }

This function is equivalent to the strchr function in the standard library.

Want to kickstart your project?Use the new AI Studio to create your code