
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
strxfrm() in C/C++
The function strxfrm() transforms the source string to the current locale and copies the first number of characters of transformed string to the destination. It is declared in “locale.h” header file in C language.
Here is the syntax of strxfrm() in C language,
size_t strxfrm(char *destination, const char *source, size_t number)
Here,
destination − The destination pointer where the characters will be copied.
source − The string is to be transformed.
number − The number of characters to be copied.
Here is an example of strxfrm() in C language,
Example
#include <stdio.h> #include <string.h> int main () has { char s[10] = "HelloWorld"; char d[10]; int n; n = strxfrm(d, s, 5); printf("Length of string : %d", n); return(0); }
Output
Length of string : 10
In the above program, two char type arrays are declared. One is the destination and another is source from where the transformed set of characters are copied to the destination. It will copy only “n” characters.
char s[10] = "HelloWorld"; char d[10]; int n; n = strxfrm(d, s, 5);
- Related Articles
- isless() in C/C++
- islessgreater() in C/C++
- isgreater() in C/C++
- modf() in C/C++
- isblank() in C/C++
- islessequal() in C/C++
- Comments in C/C++
- isgreaterequal() in C/C++
- ungetc() in C/C++
- (limits.h) in C/C++
- Pointers in C/C++
- fseek() in C/C++
- strcpy() in C/C++
- strcmp() in C/C++
- strcoll() in C/C++

Advertisements