Stack operation demo program

Source: Internet
Author: User
Tags 0xc0


# Include <stdio. h>
# Include <malloc. h>
# Include <conio. h>
# Include <math. h>

# Define OK 1
# Define ERROR 0
# Define OVERFLOW-1

Typedef int Status;
Typedef int ElemType;
Typedef int bool;

/* WIN-TC BGI graphical programming template */

# Include "Conio. h"
# Include "graphics. h"
# Include "dos. h"
# Define closegr closegraph

Void initgr (void)/* BGI initialization */
{
Int gd = DETECT, gm = 0;/* and gd = VGA, gm = VGAHI are the same effect */
Registerbgidriver (EGAVGA_driver);/* you do not need to run the. BGI file after registering the BGI driver */
Initgraph (& gd, & gm ,"");
}
Void drawmat (char * mat, int matsize, int x, int y, int color)
/* Sequence: modulo pointer, dot matrix size, starting coordinate (x, y), color */
{Int I, j, k, n;
N = (matsize-1)/8 + 1;
For (j = 0; j <matsize; j ++)
For (I = 0; I <n; I ++)
For (k = 0; k <8; k ++)
If (mat [j * n + I] & (0x80> k)/* the bit where the test is 1 is displayed */
Putpixel (x + I * 8 + k, y + j, color );
}

Char zhan64H [] = {
/* The following figure shows the 64-dot-matrix Chinese Character Library of the 'stack', Which is 512 bytes */
0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0x00,
0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0x00,
0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0x00,
0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0x00,
0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0x00,
0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0x00,
0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0x00,
0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0x00,
0x00,0x00,0x30,0x00, 0x1C, 0x00,0x00,0x00,
0 x, 0 x, 0 x, 0x00, 0x1C, 0 x, 0x80, 0x00,
0x00,0x00,0x78,0x00, 0x1C, 0x03, 0xC0, 0x00,
0x00,0x00, 0x7C, 0x00, 0x1C, 0x03, 0xC0, 0x00,
0x00,0x01, 0xFF, 0x80, 0x3F, 0xFF, 0xF0, 0x00,
0x00, 0x0F, 0xFF, 0xE3, 0xFF, 0xFF, 0xFF, 0x00,
0x01, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0x00,
0x01, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xFE, 0x00,
0x03, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xFC, 0x00,
0x03, 0xFF, 0xFF, 0xC7, 0xFF, 0x00,0x00,0x00,
0x03, 0xFF, 0xFF, 0x80, 0x0F, 0x00,0x00,0x00,
0x03, 0xFF, 0xFC, 0x00, 0x0F, 0x00,0x00,0x00,
0x03, 0xFE, 0x78,0x00, 0x0F, 0x9F, 0xF8, 0x00,
0x01, 0xE0, 0x70, 0x00, 0x3F, 0xFF, 0xFE, 0x00,
0 x, 0 x, 0 x, 0x07, 0xFF, 0xFF, 0xFE, 0x00,
0x00,0x00, 0xFC, 0x0F, 0xFF, 0xFF, 0xFC, 0x00,
0x00,0x01, 0xFE, 0x0F, 0xFF, 0xFF, 0xF8,

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.