What C string will be stored in singing_string after the following code
is run?
char singing_string[20] = "DoBeDo";
strcat(singing_string, " to you");
Assume that the code is embedded in a complete and correct program and that an include directive for <cstring> is in the program file.
The output of the given code statements:
"DoBeDo to you"
Explanation:
Complete executable code:
// Header file section
#include <iostream>
#include<cstring>
using namespace std;
//main program
int main()
{
//Initialize the variable
char singing_string[20] = "DoBeDo";
//Concat the two strings by using strcat function
strcat(singing_string, " to you");
//Print the final result
cout<<singing_string<<endl;
return 0;
}