Write code for the following functions:

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section: Chapter Questions
Problem 2PP
icon
Related questions
Question

Use C language

Exercise 2:
Write code for the following functions:
A. int strlen(const char "s); [returns string length]
B. char* strepy(char *s1, const char *s2); [Copies string s2 into array sl. The value of sl is
returned.]
C. char* strcat(char *sl,const char *s2); [Appends string s2 to array sl. The first character
of s2 overwrites the terminating null character of sl. The value of sl is returned.] Use
above function in your program to get and print length of a string, copy strl to str2 and
append str2 at the end of str1. Do not use string.h header file in your programme.
Transcribed Image Text:Exercise 2: Write code for the following functions: A. int strlen(const char "s); [returns string length] B. char* strepy(char *s1, const char *s2); [Copies string s2 into array sl. The value of sl is returned.] C. char* strcat(char *sl,const char *s2); [Appends string s2 to array sl. The first character of s2 overwrites the terminating null character of sl. The value of sl is returned.] Use above function in your program to get and print length of a string, copy strl to str2 and append str2 at the end of str1. Do not use string.h header file in your programme.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr