i just wanna ask if can i format centered the outputs of turbo c? just like when you do in microsoft word. thank you!

I'm again assuming that your output is to the command prompt. And the answer is yes, but not as easily as setting a center attribute. When it comes to "formatting" in the command prompt you need to fill the line with leading spaces to put it where you want. For example:

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

void PrintCenteredLine(const char *s)
{
    HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
    CONSOLE_SCREEN_BUFFER_INFO screen_buf;

    if (GetConsoleScreenBufferInfo(console, &screen_buf)) {
        int width = screen_buf.dwSize.X;
        int fill = (width / 2) - (strlen(s) / 2);
        int i;

        for (i = 0; i < fill; ++i)
            putchar(' ');

        puts(s);
    }
}

int main()
{
    PrintCenteredLine("Giggidy giggidy goo");
    return 0;
}

how to use center_text? can you give a sample code? thanks!

I don't know what that is. Is it some function that Turbo Shit supports?

If you don't post what you found in the help files, I have no choice but to let someone who knows what you're talking about devine what exactly you're having trouble with and explain it to you.

This article has been dead for over six months. Start a new discussion instead.