上一页 1 ··· 17 18 19 20 21
程序中动态分配的对象存放在自由存储区(free store)或堆(heap)。 C语言程序使用一对标准库函数malloc和free在自由存储区中分配存储空间,而C++语言则使用new和delete表达式实现相同的功能。 new分配失败会抛出异常,分配成功则返回分配空间的起始地址; alloc分配失败 Read More
posted @ 2013-12-02 22:26 Xylophone Views(268) Comments(1) Diggs(0)
Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa... Read More
posted @ 2013-12-02 20:20 Xylophone Views(226) Comments(0) Diggs(0)
1.内存分配 程序的内存分配有以下几个区域:堆区、栈区、全局区、程序代码区,另外还有文字常量区。 栈区 ——存放局部变量,即由auto修饰的变量,一般auto省略。由编译器自动分配释放。局部变量定义在函数体内,且无static修饰。当程序执行进入函数后 ,才为变量分配存储空间。当退出函数后,自动释放 Read More
posted @ 2013-10-31 23:44 Xylophone Views(1389) Comments(1) Diggs(0)
上一页 1 ··· 17 18 19 20 21