IA_C库函数.pptVIP

  • 4
  • 0
  • 约 36页
  • 2017-01-02 发布于河南
  • 举报
C语言常用库函数 目的与目标 学习使用C语言常用库函数 课程概述 math.h stdio.h stdlib.h malloc.h string.h assert.h 动态存储分配(malloc.h) 函数名: malloc 功 能: 内存分配函数 用 法: void *malloc(unsigned size); 程序例: #include stdlib.h /* For _MAX_PATH definition */ #include stdio.h #include malloc.h void main( void ) { char *string; /* Allocate space for a path name */ string = malloc( _MAX_PATH ); if( string == NULL ) printf( Insufficient memory available\n ); else{ printf( Memory space allocated for path name\n ); free( string ); printf( Memory freed\n ); } } 动态存储分配(malloc.h) 函数名: free 功 能: 释放已分配的块

文档评论(0)

1亿VIP精品文档

相关文档