码迷,mamicode.com
首页 >  
搜索关键字:dangling pointer    ( 2210个结果
Implement strStr()
Implement strStr().Returns a pointer to the first occurrence of needle in haystack, ornullif needle is not part of haystack.方法一:暴力破解,O(mn),超时,写了这段代码,估...
分类:其他好文   时间:2014-09-07 22:25:45    阅读次数:328
Implement strStr()
Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.思路:使用DFS即可。 1 class Solu...
分类:其他好文   时间:2014-09-06 12:10:03    阅读次数:199
C++ 智能指针详解 二
智能指针(smart pointer)是存储指向动态分配(堆)对象指针的类,用于生存期控制,能够确保自动正确的销毁动态分配的对象,防止内存泄露。它的一种通用实现技术是使用引用计数(reference count)。智能指针类将一个计数器与类指向的对象相关联,引用计数跟踪该类有多少个对象共享同一指针。...
分类:编程语言   时间:2014-09-06 10:53:53    阅读次数:374
C++技术问题总结-第9篇 智能指针
智能指针(smart pointer)是存储指向动态分配(堆)对象指针的类,能够在适当的时间自动删除指向的对象外,能够确保正确的销毁动态分配的对象。 标准库的智能指针为auto_ptr。boost库的智能指针族在功能上做了扩展。 1.auto_ptr     auto_ptr注意事项如下。 ①auto_ptr不能共享所有权。 ②auto_ptr不能指向数组。 ③auto_ptr不能作为...
分类:编程语言   时间:2014-09-05 16:18:21    阅读次数:204
【LeetCode】Copy List with Random Pointer 解题报告
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy of the list. /** * Definition for singly-lin...
分类:其他好文   时间:2014-09-04 19:12:40    阅读次数:201
Stdc--07 指针和字符串
HighLight:1. Pointer 1). 用法 2). 指针参数 3). 野指针 4). 指针返回值 5). 指针加减整数 6). 数组和指针 7). const指针和指针const2. StringPointer1. Basic 多字节的数据,将其首字节地...
分类:其他好文   时间:2014-09-04 18:52:49    阅读次数:151
Copy List with Random Pointer
特殊链表的深拷贝。...
分类:其他好文   时间:2014-09-04 17:04:19    阅读次数:171
Cocosd-x3.1 Menu使用示例
1、头文件 #include "cocos2d.h" USING_NS_CC; class MenuItemDemo : public cocos2d::Layer { public: // there's no 'id' in cpp, so we recommend returning the class instance pointer static cocos2d::S...
分类:其他好文   时间:2014-09-04 00:16:17    阅读次数:232
position:fixed部分版本的浏览器不支持
ie6-ie8浏览器不支持这个属性.fixed{ position:fixed; /*对于火狐等其他浏览器需要设置的*/ top:700px; /*同上*/ width:30px; height:30px; cursor:pointer; display:none; } .ie{ _p...
分类:其他好文   时间:2014-09-03 16:15:46    阅读次数:243
重温《STL源码剖析》笔记 第三章
第三章:迭代器概念与traits编程技法 迭代器是一种smart pointer auto_Ptr 是一个用来包装原生指针(native pointer)的对象,声明狼藉的内存泄漏问题可藉此获得解决。 auto_ptr用法如下,和原生指针一模一样:void func() { auto_p...
分类:其他好文   时间:2014-09-02 22:34:25    阅读次数:266
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!