通配符的 C 语言源代码
/* find files from wildcards, for MicroSoft C v4.0 */
/* ------------------------------------------------------------ */
/* copyright 1986: */
/* Nourse Gregg & Browne, Inc. */
/* 1 Horizon Road. #612 */
/* Fort Lee, NJ 07024 */
/* */
/* ------------------------------------------------------------ */
/* ----------------------------------------------------------------------*
This pair of routines will do a wildcard search
you must call dfirst() once to supply the search pattern
and get back the first file that matches that pattern.
then, call dnext() to get the next file in the list.
both dfirst() and dnext() return zero if a file has been found,
non-zero otherwise.
The calling parameters are as follows:
dfirst(pattern,attr,file_name,file_date,file_time,file_size);
dnext(file_name,file_date,file_time,file_size);
Where:
char *pattern; (wild card pattern. eg. "*.c" )
int attr; (the file attribute qualifier )
char *file_name; (output: the name of found file (13 bytes min.) )
int *file_date; (output: the file's date (directory format) )
int *file_time; (output: the file's time )
long *file_size; (output: the file's size in bytes )
*----------------------------------------------------------------- */
#include <dos.h>
#include <stdlib.h>
#define SET_DTA 0x1A
#define GET_DTA 0x2F
#define FIND_FIRST 0x4E
#define FIND_NEXT 0x4F
struct dta_struct {
char dummy[21];
char attr;
int time;
int date;
int low_size;
int hi_size;
char name[13];
char dummy2[14];
};
static struct dta_struct dta;
dfirst (fmask,fattr,fname,fdate,fti
相关文档:
什么是socket
长连接与短连接
所谓长连接,指在一个TCP连接上可以连续发送多个数据包,在TCP连接保持期间,如果没有数据包发送,需要双方发检测包以维持此连接,一般需要自己做在线维持。
短连接是指通信双方有数据交互时,就建立一个TCP连接,数据发送完成后,则断开此TCP连接,一般银行都使用短连接。
比如ht ......
CRT原先是指Microsoft开发的C Runtime Library,用于操作系统的开发及运行。后来在此基础上开发了C++
Runtime Library,所以现在CRT是指Microsoft开发的C/C++ Runtime
Library。在VC的CRT/SRC目录下,可以看到CRT的源码,不仅有C的,也有C++的。
CRT原先的目的就是支持操作系统的 ......
1.求下面函数的返回值(微软)
int func(x)
{
int countx = 0;
while(x)
{
countx ++;
x = x&(x-1);
}
return countx;
}
假定x = 9999。 答案:8
思路:将x转化为2进制,看含有的1的个数。
2. 什么是“引用”?申明和使用“引用”要注意哪些问题?
答:引用就是某个目标变量的&ldquo ......
1 #i nclude “filename.h”和#i nclude <filename.h>的区别?
答:对于#i nclude <filename.h>编译器从标准库开始搜索filename.h
对于#i nclude “filename.h”编译器从用户工作路径开始搜索filename.h
2 头文件的作用是什么?
答:一 ......