man strinit () - initialize a string with a given character to a given length

NAME

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

SYNOPSIS

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

DESCRIPTION

strinit initializes the string pointed to by s to be of length len, all characters being c, where the terminating len+1 characters.

RETURN VALUE

strinit will return s.

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);

SEE ALSO

AUTHOR

Lars Wirzenius (lars.wirzenius@helsinki.fi)