码迷,mamicode.com
首页 >  
搜索关键字:malloc 与free 及callo    ( 2471个结果
malloc函数
使用语句:extern void *malloc(unsigned int num_bytes);头文件:在TC2.0中可以用malloc.h或 alloc.h (注意:alloc.h 与 malloc.h 的内容是完全一致的),而在Visual C++6.0中可以用malloc.h或者stdlib...
分类:其他好文   时间:2014-05-06 00:32:40    阅读次数:279
VS2012+C语言+设置程序开机自动启动+示例
#include<stdio.h> #include<windows.h> #include<stdlib.h> char*ReplaceString(constchar*srcStr,constchar*src,constchar*dest)//替换字符串,获得文件路径 { char*ptr; intlen=strlen(srcStr); ptr=(char*)malloc(sizeof(char)*len+1); strcpy(ptr,srcSt..
分类:编程语言   时间:2014-05-05 12:29:50    阅读次数:422
写了一个二叉树构造及中序遍历函数
// BTree.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include"stdlib.h" #include"malloc.h" #define BT BTreeNode #define MS 10 typedef struct BT{ char data; struct BT *left; struct BT *right; }BT; ...
分类:其他好文   时间:2014-05-04 12:45:34    阅读次数:365
经典白话算法之归并排序
void Merge(int A[],int p,int q,int r){ int i,j,k; //计算子数组A[p..q]的元素个数 int n1 = q - p + 1; //计算子数组A[q+1..r]元素个数 int n2 = r - q; //创建子数组L,R int* L = (int*)malloc(sizeof(int)*...
分类:其他好文   时间:2014-05-04 12:44:38    阅读次数:384
C++ string中的几个小陷阱,你掉进过吗?
C++开发的项目难免会用到STL的string,使用管理都比char数组(指针)方便的多,但在得心应手的使用过程中也要警惕几个小陷阱,避免我们项目出bug却迟迟找不到原因。 1.  结构体中的string赋值问题 直接通过一个例子说明,下面的例子会输出什么: #include #include #include using namespace std; stru...
分类:编程语言   时间:2014-05-03 16:09:23    阅读次数:289
六级指针小试牛刀
指针的小秘密...
分类:其他好文   时间:2014-05-02 04:44:13    阅读次数:219
C语言中函数返回数组
#include "stdio.h"/*int* set(int a,int *c){int *b;b=malloc(sizeof(int)*3);c[0]=a;c[1]=1+a;c[2]=2+a;b[0]=13;b[1]=14;b[2]=15;return b;}*/char *set(void)...
分类:编程语言   时间:2014-05-01 13:56:31    阅读次数:306
C语言编写的bmp读写程序
C语言编写的bmp读写程序 建议先把bmp的数据存储格式了解下[cpp]view plaincopy#include"Windows.h"#include"stdio.h"#include"string.h"#include"malloc.h"unsignedchar*pBmpBuf;//读入图像数...
分类:编程语言   时间:2014-05-01 07:56:10    阅读次数:396
深入了解JS的内存机制至关重要
每种编程语言都有它的内存管理机制,比如简单的C有低级的内存管理基元,像malloc(),free()。同样我们在学习javascript的时候,很有必要了解javascript的内存管理机制。javascript的内存管理机制是:内存基元在变量(对象,字符串等等)创建时分配,然后在他们不再被使用时“...
分类:Web程序   时间:2014-04-29 11:14:47    阅读次数:563
走进C++程序世界-----operator new delete 重载
在C++ 的世界里,new 和delete 是关键字,而在C的世界里相对应的malloc和free是函数,关键C++的new和delete分析,详见前面的章节,这里就不在过多的介绍了。链接。 下面来研究下关于new 和delete的重载。  1、对比使用重载和未使用重载  未使用“/*File : operator_new.cpp *Auth : sjin *Date : 2014-04...
分类:编程语言   时间:2014-04-28 10:43:41    阅读次数:406
2471条   上一页 1 ... 245 246 247 248 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!