易截截图软件、单文件、免安装、纯绿色、仅160KB

C/C++——小编谈C语言函数那些事(25)

C程序是由一组或是变量或是函数的外部对象组成的。 函数是一个自我包含的完成一定相关功能的执行代码段。下面小编和大家分享下C语言中的函数。
 
1.   setwritemode函数
setwritemode函数的功能是设置图形方式下画线的输出模式,其用法为:void far setwritemode(int mode);程序实例如下:
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main()
{
   int gdriver = DETECT, gmode, errorcode;
   int xmax, ymax;
   initgraph(&gdriver, &gmode, "");
   errorcode = graphresult();
   if (errorcode != grOk)
   {
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Press any key to halt:");
      getch();
      exit(1);
   }
   xmax = getmaxx();
   ymax = getmaxy();
   setwritemode(XOR_PUT);
   line(0, 0, xmax, ymax);
   getch();
   line(0, 0, xmax, ymax);
   getch();
   setwritemode(COPY_PUT);
   line(0, 0, xmax, ymax);
   getch();
   closegraph();
   return 0;
}
 2.  signal函数
signal函数的功能是设置某一信号的对应动作,其用法为int signal(int sig, sigfun fname);程序实例代码如下:
#pragma inline
#include <stdio.h>
#include <signal.h>
void Catcher(int sig, int type, int *reglist)
{
   printf("Caught it!\n");
   *(reglist + 8) = 3;            
}
int main(void)
{
   signal(SIGFPE, Catcher);
   asm     mov     ax,07FFFH    
   asm     in


相关文档:

C/C++——小编谈C语言函数那些事(20)

C程序是由一组或是变量或是函数的外部对象组成的。 函数是一个自我包含的完成一定相关功能的执行代码段。下面小编和大家分享下C语言中的函数。
 
1.     setallpallette函数
setallpallette函数的功能是按指定方式改变所有的调色板颜色,其用法为:void far setallpallette(struct palette, fa ......

羊绒被誉为“软金子”也成B二C的拓荒者

羊绒被是以山羊绒为原材料针织物而成的床上用品,依据纱线种类分成粗纺织品和精纺针织物两种,依据原材料比值可以分成纯羊绒及羊绒混纺两种经加工而成的生活用品,供暖性好,盖着舒坦,尽显高档咀嚼。 本文来源:甘肃庆阳腾达商贸 ......

C标准库函数

函数名: abort
功  能: 异常终止一个进程
用  法: void abort(void);
程序例:
#include <stdio.h>
#include <stdlib.h>
 
int main(void)
{
  printf("Calling abort()\n");
  abort();
  return 0; /* This is never reached */
}
 
 
......

C/C++字符串匹配和替换

题目:输入三个字符串a,b和c,将a中b的第一次出现替换为c。
代码:
#include <iostream.h>
#include <string.h>
/*字符串替换,第一个参数为原串,第二个参数为要匹配的子串
第三个参数为要替换的第一个子串中包含第二个子串的部分*/
char *strReplace(char *str1,char *str2,char *str3);
void main() ......

C/C++——小编谈C语言函数那些事(22)

C程序是由一组或是变量或是函数的外部对象组成的。 函数是一个自我包含的完成一定相关功能的执行代码段。下面小编和大家分享下C语言中的函数。
 
1.    setmem函数
setmem函数的功能是存值到存储区,其用法为:void setmem(void *addr, int len, char value);程序实例如下:
#include <stdio.h& ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号