C – Strnset

C – Strnset 2017-07-19T23:42:16+00:00

Strnset :

Syntax :
#include<string.h>
char *strnset( const char *str,char ch ,int n);

strnset(str,ch,n) set the first n character of str to ch. quits when the first null character is found. Returns a pointer to str.

C – STRNSET EXAMPLE PROGRAM :

Output :

Before :

str  : I LIKE C PROGRAMMING

strnset(str,’@’,6)=@@@@@@ C PROGRAMMING

After :

str : @@@@@@ C PROGRAMMING

Prev Next