Translations of this page?:

free

语法:

    #include <cstdlib>
    void free( void* ptr );

free() 函数撤销ptr指向的空间,释放它以备将来使用。指针ptr必须是在之前的malloc(), calloc(), 或者 realloc()的调用中使用过的。例如:

     typedef struct data_type {
       int age;
       char name[20];
     } data;
 
     data *willy;
     willy = (data*) malloc( sizeof(data) );
     ...
     free( willy ); //lame joke

相关主题: calloc, delete, malloc, new, realloc

 
• • • SitemapRecent changesRSScc