ssttrrssttrr() -- String Function (libc)

Find one string within another
#iinncclluuddee <ssttrriinngg.hh>
cchhaarr *ssttrrssttrr(_s_t_r_i_n_g_1, _s_t_r_i_n_g_2)
cchhaarr *_s_t_r_i_n_g_1, *_s_t_r_i_n_g_2;

The  string  function  ssttrrssttrr()  looks  for  _s_t_r_i_n_g_2  within  _s_t_r_i_n_g_1.  The
terminating NUL is not considered part of _s_t_r_i_n_g_2.

ssttrrssttrr() returns a pointer to  where _s_t_r_i_n_g_2 begins within _s_t_r_i_n_g_1, or NULL
if _s_t_r_i_n_g_2 does not occur within _s_t_r_i_n_g_1.

For example,

    char *string1 = "Hello, world";
    char *string2 = "world";
    strstr(string1, string2);

returns ssttrriinngg11  plus seven, which points to the  beginning of wwoorrlldd within
HHeelllloo, wwoorrlldd.  On the other hand,

    char *string1 = "Hello, world";
    char *string2 = "worlds";
    strstr(string1, string2);

returns NULL because wwoorrllddss does not occur within HHeelllloo, wwoorrlldd.

_S_e_e _A_l_s_o
lliibbcc, ssttrriinngg.hh
ANSI Standard, section 7.11.5.7
POSIX Standard, section 8.1

_N_o_t_e_s
Neither _s_t_r_i_n_g_1 nor _s_t_r_i_n_g_2 can be more than 2,147,483,647 characters long.
