992
Appendix A: System Routines — Strings
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
strcpy
Declaration:
char *
strcpy
(char *
s1
, const char *
s2
)
Category(ies):
Strings
Description:
Copies the string pointed to by
s2
to the buffer pointed to by
s1
. If the
objects pointed to by
s1
and
s2
overlap in memory, the behavior is
undefined.
Inputs:
s1
— Buffer to copy to.
s2
— String to be copied into
s1.
Outputs:
Returns the value of
s1.
Assumptions:
s1
points to a buffer large enough to hold
s2.
Side Effects:
None
Availability:
All versions of the TI
-
89 / TI
-
92 Plus.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: strncpy
,
memcpy
,
memmove
Example:
void gr_seq_axes_lbl( SBYTE ax, char buf[] )
/* Create requested string in buf for sequence axes labels.
input: ax = -1 = n
= 0 = u
> 0 = u1 - u99
buf = buffer for string
*/
{
if( ax < 0 )
strcpy( buf, "n" ); /* n is on this axis */
else
{ /* want u or u1-u99 */
strcpy( buf, "u" );
if( ax )
sprintf( buf + 1, "%d", (BYTE)ax ); /* need to add 1-99 to string */
}
}