Skip to content

Instantly share code, notes, and snippets.

@pastagatsan
Created June 22, 2014 08:18
Show Gist options
  • Save pastagatsan/cca6a58964cb0d92f7f5 to your computer and use it in GitHub Desktop.
Save pastagatsan/cca6a58964cb0d92f7f5 to your computer and use it in GitHub Desktop.
void fill(int ln, char * str, ...)
{
int wd = 0, wh = 0, l;
getmaxyx(stdscr, wh, wd);
char * temp_str = "";
sprintf(temp_str, str, ...);
l = len(str);
mvwprintw(stdscr, ln, 0, str, ...);
for (int i = l; i < wd; i++)
{
mvwprintw(stdscr, ln, i, " ");
}
}
int len(char * string)
{
int a = 0;
while (1)
{
if (string[a] == '\0') return a;
a++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment