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?
User contributions licensed under CC BY-SA 3.0