1. Engineering
  2. Computer Science
  3. programming in c...

Question: programming in c...

Question details

programming in c catTo accepts a pointer dest to a string where you will write the concatenation of the two strings str1 and str2. For example, if stri is abc and str2 is xyz, your solution should write the string abcxyz into dest and return. Here is a complete starter file including the header file you will need to include. catto.h does include both string.h and stdio.h so you do not have to include those. #include Catto, h * Concatenate two strings and place the results in dest * @param dest The destination string for the result * @param max The maximum number of characters to write in dest * @param str1 The first string * @param str2 The second string void catTo (char *dest, size_t max, const char *strl, const char str2) // TODO: Write the function here The program quiz system is persistent, meaning your program will remain in the window below until the assignment closes. Hints and Suggestions If you have used sizeof at any place in your solution, you are incorrect. If you have two calls to strncat in your solution you are incorrect.For this quiz, you must write an implementation of the function catTo: void catTo (char *dest, size_t max, const char strl, const char *str2) Write your solution in the window below labeled Code. At any time you can press the Test button below to send your solution to a remote system for testing. The compilation and testing results will appear in the second window below labeled Result. When you have completed the quiz, press Submit to submit your solution. Be sure to also press Finish Quiz to get credit for the quiz. catTo accepts a pointer dest to a string where you will write the concatenation of the two strings str1 and str2. For example, if strl is abc and str2 is xyz, your solution should write the string abcxyz into dest and return. Here is a complete starter file including the header file you will need to include. catto.h does include both string.h and stdio.h so you do not have to include those. #include Cattoh Concatenate two strings and place the results in dest *@param dest The destination string for the result @param max The maximum number of characters to write in dest *@param str1 The first string *@param str2 The second string void catTo (char *dest, size_t max, const char *strl, const char *str2)

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution