void str_init(char* str, int n) { for (int i = 0; i < n; i++) str[i] = ' '; str[n] = '\0'; } // could also use