C – Strnset

C – Strnset 2017-08-06T09:19:28+00:00

Strnset :

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.

Syntax :
char *strnset( const char *str,char ch ,int n);

C – STRING EXAMPLE PROGRAM :

Output :

Before :

str  : I LIKE C PROGRAMMING

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

After :

str : @@@@@@ C PROGRAMMING

Prev Next