use of strstr in c++

#include <iostream>
#include <cstring>

int main() {
    const char *str1 = "Hello, World!";
    const char *str2 = "World";

    // Using strstr to find str2 in str1
    const char *result = strstr(str1, str2);

    // Checking if str2 is present in str1
    if (result != nullptr) {
        std::cout << "Substring found: " << result << std::endl;

        // Finding the position of the substring in str1
        size_t position = result - str1;
        std::cout << "Position of substring: " << position << std::endl;
    } else {
        std::cout << "Substring not found." << std::endl;
    }

    return 0;
}