Strings In Depth4 / 18
Up next

Fill with memset

#include <stdio.h>
#include <string.h>

int main(void) {
    char line[6];
    memset(line, '-', 5);
    line[5] = '\0';
    printf("%s\n", line);
    return 0;
}
What you're solving

repeat one byte, then terminate