strcat - C string.h

C examples for string.h:strcat

Type

function

From

<cstring> 
<string.h>

Description

Concatenate strings

Prototype

char * strcat ( char * destination, const char * source );

Parameters

Parameter Description
destination Pointer to the destination array, and large enough to contain the concatenated string.
source C string to be appended.

Return Value

destination is returned.

Demo Code


#include <stdio.h>
#include <string.h>

int main ()/*from w  w w  .ja v a2  s.c o  m*/
{
  char str[80];
  strcpy (str,"these ");
  strcat (str,"strings ");
  strcat (str,"are ");
  strcat (str,"concatenated.");
  puts (str);
  return 0;
}

Related Tutorials