I did manage to get to the horizontal line (row) to the center but not vertically. Please help, I am still a noob so if you can explain your code, that would be much appreciated.
Thanks
#include <sys/ioctl.h>
#include <stdio.h>
#include <string.h>
int main()
{
struct winsize w;
ioctl(0, TIOCGWINSZ, &w);
int columns = w.ws_col;
int rows = w.ws_row;
//printf("Lines : %d\n", rows);
//printf("Columns ; %d\n", columns);
char *string = "Hello World";
int stringLength = strlen(string) / 2;
printf("%*s\n", columns / 2 + stringLength, string );
//getchar(); //Pause program
return 0;
}