璐村惂鐢ㄦ埛_00aUW3e馃惥
-
关注数: 0
粉丝数: 1
发帖数: 45
关注贴吧数: 0
请教far、near这2个关键字的意思 RT,书上都没有这2关键字的意思,但是很多书上都有用,不明白,指教下
求教:TC作图颜色的问题!~ TC里只有16色可用,当系统需要用到16色以上的时候,一般用什么方法解决比如说:自己写了256色的图形模版,用的10中断读一张256色BMP图,8位,处理后的RGB值怎么画到屏幕上?疑惑!~~
请教:C库的建立,或者将库还原成.H的方法 一直都只知道用库,从来没看过库里是什么,所有请大家帮帮忙了
[转]帖吧也可以用数字代表符号 如图
这个程序难道是要把TXT变MID!~ /* file rec.cppby dustin caldwell (
[email protected]
)*/#include #include #include #include void helpdoc();main(int argc,char *argv[]){FILE *rfp, *wfp;unsigned char ch, c;char s[20];if((rfp=fopen(argv[1], "r"))==NULL) /* open the read file */{printf("cannot open file %s \n",argv[1]);helpdoc();exit(-1);}if((wfp=fopen(argv[2], "wb"))==NULL) /* open the write file */{printf("cannot open file %s \n",argv[1]);helpdoc();exit(-1);}c=0;ch=fgetc(rfp);while(!feof(rfp)) /* loop for whole file */{if(isalnum(ch)) /* only 'see' valid ascii chars */{c=0;while(isdigit(ch)) /* only use decimal digits (0-9) */{s[c]=ch; /* build a string containing the number */c++;ch=fgetc(rfp);}s[c]=NULL; /* must have null terminator */fputc(atoi(s), wfp);/* write the binary equivalent to file */}ch=fgetc(rfp); /* loop until next number starts */}fclose(rfp); /* close up */fclose(wfp);}void helpdoc() /* print help message */{printf("\n text file encoder\n\n");printf("\n syntax: rec text_file_name binary_file_name\n\n");printf("by dustin caldwell (
[email protected]
)\n\n");printf("this is a program that reads an ascii tab-\n");printf("delimited file and builds a binary file where\n");printf("each byte of the binary file is one of the decimal\n");printf("digits in the text file.\n");printf(" eg:\n\n");printf("c:\>rec son3.txt son3.mid\n\n");printf("(this will create a file called son3.mid which is\n");printf("a valid binary file)\n\n");printf("(dec.exe may also be useful, as it decodes binary files)\n\n");printf("have fun!!\n");}
西文系统外挂字库"画"汉字问题!~ #include "graphics.h"#include "stdio.h"void huadian(char *hz,int x,int y,int ys)/*根据字模画点函数*/{int i,j,k;for (i=0;i<16;i++)for (j=0;j<2;j++) for (k=0;k<8;k++) if (hz[i*2+j]&(0x80>>k)) putpixel(x+k+j*8,y+i,ys);}int main(){int dm=VGA,gm=VGAHI;double i,j; /*我的问题在这里*/unsigned char zk[32],hzbuff[3]="情";FILE *fp;initgraph(&dm,&gm,"");i=hzbuff[0]-0xA0,j=hzbuff[1]-0xA0;/*内码与区位的相差是160,所以*/fp=fopen("hzk16","rb");if(fp==NULL) { printf("file not find!"); getch(); exit(0); }fseek(fp,(94*(i-1)+(j-1))*32,0);/*根据区位找到要显示汉字的地址*/fread(zk,32,1,fp);fclose(fp);huadian(zk,100,100,RED);getch();closegraph();}外挂的字库是UCDOS的HZK16本程序可以正常显示汉字,但是为什么必须是double才能正确显示
1
下一页