Question: Writing a function in C to copy from string source to string destination? How to do? Write a function with prototype void string_copy(const char source[],

 Writing a function in C to copy from string source to

Writing a function in C to copy from string source to string destination? How to do?

Write a function with prototype void string_copy(const char source[], char destination[], int n); This function copies string source to string destination. Parameter n represents the size of array destination. If the latter array is not sufficiently large to hold the whole source string then only the prefix of the string which has room in the latter array should be copied. Note that after copying, the null character should also be included to mark the end of string destination. Write a program to test your functions You are not allowed to use any function declared in string.h. You may write a function which returns the length of a string and use it if you need it. Recall that a string is a char array with the null character marking the end. The length of the string is the number of characters in the array appearing before the null character

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!