strxfrm - C string.h

C examples for string.h:strxfrm

Type

function

From

<cstring> 
<string.h>

Description

Transforms C string source using the current locale and copies the first num characters of the transformed string to destination, returning its length.

Prototype

size_t strxfrm ( char * destination, const char * source, size_t num );

Parameters

Parameter Description
destination Pointer to the destination array where the content is to be copied.
source C string to be transformed.
num Maximum number of characters to be copied to destination.

Return Value

The length of the transformed string.

Demo Code


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

int main ()/*from w  w  w. ja v a 2s  .  com*/
{
  char str[] ="- This, a sample string.";
  char des[80];

  size_t i = strxfrm(des,str,30);
  printf ("%d\n", i);
  printf ("%s\n", des);
  
  return 0;
}

Related Tutorials