logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

strinit - initialize a string with a given character to a given length

Author

       Lars Wirzenius (lars.wirzenius@helsinki.fi)

Publib                                        C Programmer's Manual                                STRINIT(3pub)

Description

strinit  initializes  the  string  pointed to by s to be of length len, all characters being c, where the
       terminating '\0' is not included in the length, i.e., the string will use len+1 characters.

Example

       To initialize a string to consist of twenty underscores, one would do the following.

            #include <publib.h>

            char string[21];     /* note 21 to make room for '\0' */
            strinit(string, '_', 20);

Name

       strinit - initialize a string with a given character to a given length

Return Value

strinit will return s.

See Also

publib(3)

Synopsis

       #include <publib.h>
       char *strinit(char *s, int c, size_t len) {

See Also