'Why windows BGI can not show when have these code(c programming)

I have these code

#include<graphics.h>
#include<conio.h>
#include<stdio.h>

struct Board
{
    int x,y;
    char block[2];
} boardXY[32];

int main()
{
    int c_int1,c_int2,c_int3,c_int4;
    char c_char1,c_char2;

    for(c_int1=0,c_char1='1',boardXY[0].y = 463,c_int3=0; c_char1<='8'; c_char1++,c_int3++)
    {
        for(c_char2='A',c_int2=0,boardXY[0].x = 503; c_char2<='H'; c_char2++,c_int1++,c_int2++)
        {
            boardXY[c_int1].block[0]=c_char2;
            boardXY[c_int1].block[1]=c_char1;
            boardXY[c_int1].x = 503 + (45*c_int2);
            boardXY[c_int1].y = 463 - (45*c_int3);
        }
    }

    int gd=DETECT,gm;
    initgraph(&gd,&gm,"c\\tc\\bgi");
    outtext("hi chess");
    getch();
    return 0;
}

They can run but the windows BGI that should have text "hi chess" is empty. On the other hand, after I delete all for loop then they can run and show "hi chess" properly.

My questions is

How can I show "hi chess" without delete all of for loop.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source