The function void strncat (char destination[], const char source[], int num) appends the first num characters of
Fantastic news! We've Found the answer you've been seeking!
Question:
The function
void strncat (char destination[], const char source[], int num)
appends the firstnumcharacters ofsourcetodestination, plus a terminating null-character. If the length of the C string in source is less thannum, only the content up to the terminating null-character is copied.
Write the function strncat:
Write the call to the strncat function so that the contents insrcis safely appended todest.
#include
const int MAXDESTINATION = 40;
const int MAXSOURCE = 150;
int main()
{
char dest[MAXDESTINATION+1] = "It don't mean a thing";
char src[MAXSOURCE+1] = " if it don't got the Go-Go swing!";
int a = strlen(dest);
int b = strlen(src);
// Your code would go here
}
Posted Date: