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

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

 C程序是由一组或是变量或是函数的外部对象组成的。 函数是一个自我包含的完成一定相关功能的执行代码段。下面小编和大家分享下C语言中的函数。
 
1.       parsfnm函数
 
parsfnm函数的功能是分析文件名,其用法为:char *parsfnm (char *cmdline, struct fcb *fcbptr, int option);程序实例如下:
#include <process.h>
#include <string.h>
#include <stdio.h>
#include <dos.h>
int main(void)
{
   char line[80];
   struct fcb blk;
   printf("Enter drive and file name (no path - ie. a:file.dat)\n");
   gets(line);
   if (parsfnm(line, &blk, 1) == NULL)
      printf("Error in parsfm call\n");
   else
      printf("Drive #%d  Name: %11s\n", blk.fcb_drive, blk.fcb_name);
   return 0;
}
2.      peek函数
 
peek函数的功能是检查存储单元,其用法为:int peek(int segment, unsigned offset);程序实例代码如下:
#include <stdio.h>
#include <conio.h>
#include <dos.h>
int main(void)
{
   int value = 0;
   printf("The current status of your keyboard is:\n");
   value = peek(0x0040, 0x0017);
   if (value & 1)
      printf("Right shift on\n");
   else
      printf("Right shift off\n");
   if (value & 2)
      printf("Left shift on\n");
   else
      printf("Left shift off\n");
   if (value & 4)
      printf("Control key on\n");
   else
      printf("Control key off\n");
   if (value & 8)
      printf("Alt key on\n");
   else
      printf("Alt key off\n");
   if (value & 16)
  &nb


相关文档:

VC .NET中String^ 与ANSI C char*互转

VC.NET中的String类是利用Unicode字符集编码来表示文本。Unicode字符集中每个字符(汉字、英文字母)都占2个字节,且其字符串是以2个连续的\0结尾的。
ANSI的ASCII字符集是最常见的字符集,常用于表示txt的文本文件。在ASCII字符集中英文占一个字节,汉字2个字节,且其字符串是以一个\0结尾的。
在利用VC.NET进行混合编程时 ......

zz Emacs C

日期:2009-11-21   10:54:22
本节主要参考:
    曹乐的《在Emacs下用C/C++编程》
    王纯业的《Emacs 一个强大的平台》
    emacswiki.org
emcas难学易用,可扩展性强。有人把她当作信仰,有人认为他是魔鬼!学习首先记住基本的键盘快捷键,学会常用插件, ......

C/C++软件工程师就业求职手册节选二

 5、#define宏定义。宏只是简单的文本替换,很容易引起歧义。
#include <stdio.h>
#define CONS(a,b) (int)(a##e##b)
#define STR(s) #s
int main()
{
   printf(STR(vck));
   printf("\n");
   printf("%d\n",CONS(2,3));
   return 0; ......

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

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