VC函数库

函数名 : _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\n ); 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

文档评论(0)

1亿VIP精品文档

相关文档