Writing to 0xb8000000 yields output on screen without any print statements such as `printf`

前端 未结 6 770
时光取名叫无心
时光取名叫无心 2020-12-15 12:35
#include 
#include 

void main()
{
  char far *v = (char far*)0xb8000000;
  clrscr();

  *v = \'w\';
  v += 2;
  *v = \'e\';

  getch()         


        
6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-15 12:53

    First, it gets the address of the beginning of the video buffer. It then clears the screen, and starts adding text to the buffer.

提交回复
热议问题