函数名: _access
所属库名: <io.h>
函数功能: 检查某个文件的存取方式,比如说是只读方式、
只写方式等。如果指定的存取方式有效,则函数返回 0,否
则函数返回-1
使用方法: int _access( const char *path, int mode );
范 例:
这个例子使用-access 函数来检查文件 access.c 是否是可写
的:
include <io.h>
include <stdio.h>
include <stdlib.h>
void main( void )
{
if( (_access( "ACCESS.C", 0 )) != -1 )
{ printf( "File ACCESS.C exists" );
if( (_access( "ACCESS.C", 2 )) != -1 )
函数名 : _alloca
所属库名: <malloc.h>
函数功能: 在堆栈上分配一个内存空间,返回一个指向该
内存空间地址的 void 型指针
使用方法: void *_alloca( size_t size );
范 例:
在堆栈上分配一个 50 字节的内存空间: Int *pointer; size_t
Size=100; Pointer=(int *)_alloca(Size);
函数名 : _atoi64
所属库名: <stdlib.h>
函数功能: 把一个字符串转换为_int64 型
使用方法: __int64 _atoi64( const char *string );
范 例:
和 atof 函数类似
函数名 : _beginthread
所属库名: <process.h>
函数功能: 创建一个线程
使 用 方 法 : unsigned long _beginthread( void( __cdecl
*start_address )( void * ), unsigned stack_size, void *arglist );
unsigned long _beginthreadex(
范 例:
这个例子显示了_beginthread 函数的基本用法,FirstThread
是线程的起始地址,数字 20 是线程的堆栈空间,常量
NULL 是 线 程 的 参 数 表 :
_beginthread(FirstThread,20,NULL);
函数名 : _beginthreadex
所属库名: <process.h>
函数功能: 创建一个线程
使 用 方 法 : unsigned long _beginthreadex( void *security,
unsigned stack_size, unsigned ( __stdcall *start_address )( void
* ), void *arglist, unsigned initflag, unsigned *thrdaddr );
范 例:
和_beginthread 函数类似
函数名 : _c_exit
所属库名: <process.h>
函数功能: 进行清除操作(释放已占用的内存空间等),
但是不终止程序
使用方法: void _c_exit( void );
范 例:
和_cexit 函数类似
函数名 : _cabs
所属库名: <math.h>
函数功能: 计算一个复数的绝对值
使用方法: double _cabs( struct _complex z );
范 例:
把一个复数 ComplexNumber 赋给变量 d:struct _complex
number = { 3.0, 4.0 };
double d; d = _cabs( number );
函数名 : _cexit
所属库名: <process.h>
函数功能: 进行清除操作(释放已占用的内存空间等),
但是不终止程序
使用方法: void _cexit( void );
范 例:
这个例子中如果用户按下 y 键,则进行清除操作: int
button; _cputs("Yes or No?"); button=_getch();
if(toupper(button)=='y') _cexit();
函数名 : _cgets
所属库名: <conio.h>
函数功能: 从键盘得到一个字符串
使用方法: char *_cgets( char *buffer );
范 例:
数字 80 用来限制屏幕上每行最多只能输入 80 个字符:
char *string; char Buffer[82]={80};
string=_cgets(Buffer);
函数名 : _chdir
所属库名: <direct.h>
函数功能: 改变当前的工作目录,若成功则返回0,否则
返回-1,
使用方法: int _chdir( const char *dirname );
范 例:
这 个 例 子 中 实 现 了 把 当 前 目 录 改 为 d:isual c++:
_chdir("d;\visual c++");