STRCPY(3) BSD Programmer's Manual STRCPY(3) NNAAMMEE ssttrrccppyy - copy strings SSYYNNOOPPSSIISS ##iinncclluuddee <<ssttrriinngg..hh>> _c_h_a_r _* ssttrrccppyy(_c_h_a_r _*_d_s_t, _c_o_n_s_t _c_h_a_r _*_s_r_c); _c_h_a_r _* ssttrrnnccppyy(_c_h_a_r _*_d_s_t, _c_o_n_s_t _c_h_a_r _*_s_r_c, _s_i_z_e___t _l_e_n); DDEESSCCRRIIPPTTIIOONN The ssttrrccppyy() and ssttrrnnccppyy() functions copy the string _s_r_c to _d_s_t (includ- ing the terminating `\0' character). The ssttrrnnccppyy() copies not more than _l_e_n characters into _d_s_t, appending `\0' characters if _s_r_c is less than _l_e_n characters long, and _n_o_t termi- nating _d_s_t if _s_r_c is more than _l_e_n characters long. RREETTUURRNN VVAALLUUEESS The ssttrrccppyy() and ssttrrnnccppyy() functions return _d_s_t. EEXXAAMMPPLLEESS The following sets ``chararray'' to ``abc\0\0\0'': (void)strncpy(chararray, "abc", 6). The following sets ``chararray'' to ``abcdef'': (void)strncpy(chararray, "abcdefgh", 6); SSEEEE AALLSSOO bcopy(3), memccpy(3), memcpy(3), memmove(3) SSTTAANNDDAARRDDSS The ssttrrccppyy() and ssttrrnnccppyy() functions conform to ANSI C X3.159-1989 (``ANSI C ''). 4th Berkeley Distribution June 4, 1993 1