Reference no: EM13166139
Write a program that will define the followingstring manipulation functions. Each is analogous to the
corresponding C++ string function.
STRLEN( Str &, Len &) Sent the address of a string, it returns the length in a call-by-reference param.
STRCPY( Dest &, Source & ) Sent the address of the Source string, it places a copy of it in the Destination
string.
STRCAT( Dest &, Source & )Sent the address of the Source String, a copy of it is attached to the end of
the Destination string.
The test program will do at least the following:
S1 = "I "
S2 = "love "
S3 = "assembly "
S4 = S1 + S2 + S3 (using STRCAT)
S5 = S3 (using STRCPY)
S6 = S4 (using STRCPY )
L1 = STRLEN( S1)
L4 = STRLEN( S4)
2.) Also write a STRCMP function that returns two values, representing the Z and N
indicators. Compare the following strings and output something like : "I < love" for the first one.
Compare:
S1 and S2
S1 and S3
S1 and S4
S6 and S4
S5 and S3