"Access violation reading location 0x00000048" error in C - solved

-1

I'm trying to write a text letter by letter to have a typewriter semblance. Except I'm getting this exception : Exception thrown at 0x768A3501 (ucrtbase.dll) in BGIFirstTest.exe: 0xC0000005: Access violation reading location 0x00000048. This is a section of my code relative to the error.

int i;
char introduction[95] = {"Hi! I'm Mr. Circle ! I'm in love with Mrs. Square, but she doesn't love me ! What should I do?"},output[1];
settextjustify(LEFT_TEXT, CENTER_TEXT);
settextstyle(0, HORIZ_DIR, 15);
int x_intro_text = 0, y_intro_text = 200;
for (i = 0;i < 95;i++)
{
    sprintf_s(output, "%c", introduction[i]);
    moveto(x_intro_text, y_intro_text);
    outtext(output);
    delay(50);
    x_intro_text += 20;

}

Do you have any ideas?

c
bgi
asked on Stack Overflow Apr 9, 2020 by Alcapaca • edited Apr 9, 2020 by Alcapaca

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0