一哥们儿(__weak_Point)把自己在百度的面试题贴到了网上 面试题在百度面试题第八题 ,刚好当初公司面试我的时候也问到了这个问题。(当时没回答上来,最近又看到这个问题,就问总结了一下)

相信很多的人在工作和学习中都会遇到这个问题

图中的代码如下,注意代码是再非ARC中运行的

//注意,这些代码是在非ARC下运行的。- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view, typically from a nib.UIView * view1 = [[UIView alloc]init];//View1指向对象的引用计数为0,对象销毁4[self freeView:view1];//view的对象此时已销毁,出现野指针,程序崩溃[view1 setBackgroundColor:[UIColor orangeColor]];
}
//将传过来的对象release掉
- (void)freeView:(NSObject *)obj{[obj release];
}

上面的代码很简单,一眼就可以看出什么地方出了问题,但是在实际的工作中,代码逻辑关系都很复杂,如果不小心释放了对象,出现这个问题,找起来是比较麻烦的。尤其是接管别人的代码。

这里就来说一下具体的结局方案

我们知道程序运行的时候,我们创建的对象都是存储在堆内存上的。我们可以通过监测堆内存上内存的变化,来监出现野指针的区域。这样就可以知道在哪里出现了问题。

Xcode 提供了运行程序时记录当前进程 堆内存变化的功能。现在我们打开这个功能,如下图所示。

然后我们运行程序,注意控制台输出。

malocHistory(3491,0x10d8ae300) malloc: stack logs being written into /tmp/stack-logs.3491.114ce0000.malocHistory.TJzvuk.index
malocHistory(3491,0x10d8ae300) malloc: recording malloc and VM allocation stacks to disk using standard recorder
malocHistory(3491,0x10d8ae300) malloc: process 3308 no longer exists, stack logs deleted from /tmp/stack-logs.3308.1126eb000.malocHistory.Kovf7r.index

控制台中说大概意思就是内存非配得历史已经开始记录,被写在了/tmp/stack-logs 文件夹下面。某个进程(process)已经不再存在了。记录他的mallocHistoy文件被删除。

我们到这个目录上看一下。(下面的代码是在我的pro上控制台中输入的,截图太慢了,==\\)

zhangxuongdeMBP:tmp zhangxudong$ cd /tmp
zhangxuongdeMBP:tmp zhangxudong$ ls
KSOutOfProcessFetcher.501.IW-ShwaXJwmHlkfc5wb2ZMHOaJY=
NanoPreferencesSync
PlugInKit-Annotations
com.apple.CoreSimulator.SimDevice.6CAB348C-8E57-4F2A-A2B3-3326F2F84D8D.launchd_sim
com.apple.CoreSimulator.SimDevice.D83EE71A-C375-44A4-8F5F-E704CAED94FE.launchd_sim
com.apple.launchd.0u21btl7qC
com.apple.launchd.Vl0gfUy0kT
com.apple.launchd.YgEnK6wsOi
com.apple.launchd.kXJa1h1Vr9
com.apple.launchd.v3PwxXkHWX
com.sogou.inputmethod
fm_sg_cloud_cache.v0.filemap.sogouime_3.2.0.69954_00000000_501
stack-logs.3491.114ce0000.malocHistory.TJzvuk.index  #这个就是控制台中讲的文件
zhangxuongdeMBP:tmp zhangxudong$ 

我们查看一下 这个文件

zhangxuongdeMBP:tmp zhangxudong$ cat stack-logs.3491.114ce0000.malocHistory.TJzvuk.index U5??%?pU??ƚ?pU???0?U5?s?UU???k?UU???x?U???FbE?U????BT?????U????5U????C@uU????a%U???K?U????(?U????u(?U????u(UT????u(W????u(?W????uUUл???(UUл??u(eUл??u(5Uл??u(?Uл??u(?Uл??u(?Uл??u(uTл??u(Tл??u(?Tл??u(?Tл??u(?Tл??u(EWл??u(Wл??u(%Wл??u(?Wл??u(?Wл??u(UVл??u(eVл??u(5Vл??u(?Vл??u(?Vл??u(?Vл??u(uQл??u(Qл??u(?Qл??u(?Qл??u(?Qл??u(EPл??u(Pл??u(%Pл??u(?Pл??u(?Pл??u(USл??u(eSл??u(5Sл??u(?Sл??u(?Sл??u?Sл?? ERл?c eRл?MRл?ď 5Rл?ü?Rл?? ?Rл??0?Rл?Y_?Rл????Rл?  Rл?é??Rл?z2Rл?VN ?Rл?&EÅл??uöл??,EÅл?R??Rл??U%???U???o?U%?6? EÅл? eÅл????UU???????UU????? Åл?   ??Uu???Z?%Åл??% ?Åл???Åл?k% ?Åл??0?Åл?i??Åл?0?Rл??(?Åл?ÄU????(?Åл??;U???0?UU??ɻ?UU??>Huöл??US??>HUU???DUE??>HUS???D Uw??>HUE???D@U??>HUw???D?U???>HU???DUÅ??>HU????DU???6?U??>HÅ???DU???6?U??>HU???U???6U??>HU???DU???6?U??>HU???D?Åл?huöл?oXeÜл??)?Üл??X?^л??)EYл??XeYл??)?Yл??X?Yл??)EXл??XeXл??)?Xл??X?Xл??)E[л??Xe[л??)?[л??X?[л??)EZл??XeZл??)!?Zл??X?Zл??)uEл??XEл??)?Eл??X?Eл??)uDл??XDл??)Rл??X?Dл??)UGл??XuGл??)?Gл??X?Gл??)
//........此处省略一万行 反正也看不懂.......................
?ӻ?>j?ӻ???ߐ????U}???F5?????D???????????.??I???~??K?????zhangxuongdeMBP:tmp zhangxudong$ 

恩,这个文件我们是读不懂了。下面使用malloc_history 命令

查看一下命令帮助

zhangxuongdeMBP:images zhangxudong$ malloc_history --help
[invalid usage]: no process id or name specified //无效的使用方法,没有制定有效的进程id或者进程名
malloc_history: Displays/aggregates allocation histories in a process
Usage: malloc_history <pid/partial-process-name> [options] <mode> [<address> ...] //显示进程中内存分配的历史 使用方法是  malloc_history <进程id/或者进程的名字> [操作选项] <mode> [内存地址]
'mode' should be one of {-callTree, -allBySize, -allByCount, -allEvents, or one or more addresses}-allBySize                        [mode]
    -allByCount                       [mode]
    -allEvents                        [mode]
    -callTree                         [mode]
    -highWaterMark
    -showContent                      (-calltree only)
    -invert                           (-calltree only)
    -ignoreThreads                    (-calltree only)
    -collapseRecursion                (-calltree only)
    -chargeSystemLibraries            (-calltree only)
    -consolidateAllBySymbol           (-calltree only)
    -consolidateSystemFramesBySymbol  (-calltree only)
zhangxuongdeMBP:images zhangxudong$ 

进程名,可以通过上面控制台的输出知道,3491。
对应的内存地址,从前前面已经知道是 0x00007fcbbd9345f0

从控制台中查询。

zhangxuongdeMBP:images zhangxudong$ malloc_history 3491 0x00007fcbbd9345f0
malloc_history Report Version:  2.0
Invalid connection: com.apple.coresymbolicationd
ALLOC 0x7fcbbd9345f0-0x7fcbbd93471f [size=304]: thread_10d8ae300 |start | main | UIApplicationMain | -[UIApplication _run] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoBlocks | __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ | __31-[FBSSerialQueue performAsync:]_block_invoke_2 | -[UIApplication workspaceDidEndTransaction:] | -[UIApplication _runWithMainScene:transitionContext:completion:] | -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:] | -[UIWindow _initWithOrientation:] | -[UIView init] | -[UIStatusBarWindow initWithFrame:] | -[UIWindow _initWithFrame:debugName:scene:attached:] | -[UIApplication _updateCurrentStatusBarViewControllerAppearance] | -[UIApplication _setStatusBarStyle:animationParameters:] | -[UIStatusBar _requestStyleAttributes:animationParameters:] | -[UIStatusBar _prepareToSetStyle:animation:] | +[UIView(Animation) performWithoutAnimation:] | __44-[UIStatusBar _prepareToSetStyle:animation:]_block_invoke | -[UIStatusBarForegroundView setStatusBarData:actions:animated:] | -[UIStatusBarForegroundView _setStatusBarData:actions:animated:] | -[UIStatusBarForegroundView _reflowItemViewsWithDuration:preserveHistory:] | -[UIStatusBarForegroundView _computeVisibleItemsPreservingHistory:] | -[UIStatusBarLayoutManager distributeOverlap:amongItems:] | -[UIStatusBarServiceItemView addContentOverlap:] | -[UIStatusBarServiceItemView updateContentsAndWidth] | -[UIStatusBarServiceItemView _contentsImageFromString:withWidth:letterSpacing:] | -[UIStatusBarForegroundStyleAttributes imageWithText:ofItemType:forWidth:lineBreakMode:letterSpacing:textAlignment:style:withLegibilityStyle:legibilityStrength:] | -[NSString(UIStringDrawingLegacy) _legacy_sizeWithFont:forWidth:lineBreakMode:letterSpacing:] | -[NSString(NSExtendedStringDrawing) boundingRectWithSize:options:attributes:context:] | __NSStringDrawingEngine | CTLineCreateTruncatedLineWithTokenHandler | TTruncator::EndTruncate(double, __CTRun const* (__CTLine const*, CFRange*, __CFDictionary const*) block_pointer) | TTruncator::CreateToken(CFRange&, __CTRun const* (__CTLine const*, CFRange*, __CFDictionary const*) block_pointer) | ____NSStringDrawingEngine_block_invoke_2 | CTLineCreateWithAttributedString | TTypesetterAttrString::TTypesetterAttrString(__CFAttributedString const*) | TTypesetterAttrString::Initialize(__CFAttributedString const*) | TGlyphEncoder::EncodeChars(CFRange, TAttributes const&, TGlyphList<TDeletedGlyphIndex>&, TGlyphEncoder::Fallbacks) | _CFRuntimeCreateInstance | malloc_zone_malloc
----
FREE  0x7fcbbd9345f0-0x7fcbbd93471f [size=304]: thread_10d8ae300 |start | main | UIApplicationMain | -[UIApplication _run] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoBlocks | __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ | __31-[FBSSerialQueue performAsync:]_block_invoke_2 | -[UIApplication workspaceDidEndTransaction:] | -[UIApplication _runWithMainScene:transitionContext:completion:] | -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:] | -[UIWindow _initWithOrientation:] | -[UIView init] | -[UIStatusBarWindow initWithFrame:] | -[UIWindow _initWithFrame:debugName:scene:attached:] | -[UIApplication _updateCurrentStatusBarViewControllerAppearance] | -[UIApplication _setStatusBarStyle:animationParameters:] | -[UIStatusBar _requestStyleAttributes:animationParameters:] | -[UIStatusBar _prepareToSetStyle:animation:] | +[UIView(Animation) performWithoutAnimation:] | __44-[UIStatusBar _prepareToSetStyle:animation:]_block_invoke | -[UIStatusBarForegroundView setStatusBarData:actions:animated:] | -[UIStatusBarForegroundView _setStatusBarData:actions:animated:] | -[UIStatusBarForegroundView _reflowItemViewsWithDuration:preserveHistory:] | -[UIStatusBarForegroundView _computeVisibleItemsPreservingHistory:] | -[UIStatusBarLayoutManager distributeOverlap:amongItems:] | -[UIStatusBarServiceItemView addContentOverlap:] | -[UIStatusBarServiceItemView updateContentsAndWidth] | -[UIStatusBarServiceItemView _contentsImageFromString:withWidth:letterSpacing:] | -[UIStatusBarForegroundStyleAttributes imageWithText:ofItemType:forWidth:lineBreakMode:letterSpacing:textAlignment:style:withLegibilityStyle:legibilityStrength:] | -[UIStatusBarForegroundStyleAttributes drawText:forWidth:lineBreakMode:letterSpacing:textAlignment:style:textSize:textHeight:] | -[NSString(UIStringDrawingLegacy) _legacy_drawAtPoint:forWidth:withFont:lineBreakMode:letterSpacing:includeEmoji:] | -[NSAttributedString(NSExtendedStringDrawing) drawWithRect:options:context:] | __NSStringDrawingEngine | CTLineCreateTruncatedLineWithTokenHandler | TTruncator::EndTruncate(double, __CTRun const* (__CTLine const*, CFRange*, __CFDictionary const*) block_pointer) | TTruncator::CreateToken(CFRange&, __CTRun const* (__CTLine const*, CFRange*, __CFDictionary const*) block_pointer) | ____NSStringDrawingEngine_block_invoke_2 | CFRelease | malloc_zone_free ALLOC 0x7fcbbd9345f0-0x7fcbbd934647 [size=88]: thread_10d8ae300 |start | main | UIApplicationMain | -[UIApplication _run] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoBlocks | __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ | __31-[FBSSerialQueue performAsync:]_block_invoke_2 | -[UIApplication workspaceDidEndTransaction:] | -[UIApplication _runWithMainScene:transitionContext:completion:] | -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:] | -[UIWindow _initWithOrientation:] | -[UIView init] | -[UIStatusBarWindow initWithFrame:] | -[UIWindow _initWithFrame:debugName:scene:attached:] | -[UIApplication _updateCurrentStatusBarViewControllerAppearance] | -[UIApplication _setStatusBarStyle:animationParameters:] | -[UIStatusBar _requestStyleAttributes:animationParameters:] | -[UIStatusBar _prepareToSetStyle:animation:] | +[UIView(Animation) performWithoutAnimation:] | __44-[UIStatusBar _prepareToSetStyle:animation:]_block_invoke | -[UIStatusBarForegroundView setStatusBarData:actions:animated:] | -[UIStatusBarForegroundView _setStatusBarData:actions:animated:] | -[UIStatusBarForegroundView _reflowItemViewsWithDuration:preserveHistory:] | -[UIStatusBarForegroundView _computeVisibleItemsPreservingHistory:] | -[UIStatusBarLayoutManager distributeOverlap:amongItems:] | -[UIStatusBarServiceItemView addContentOverlap:] | -[UIStatusBarServiceItemView updateContentsAndWidth] | -[UIStatusBarServiceItemView _contentsImageFromString:withWidth:letterSpacing:] | -[UIStatusBarForegroundStyleAttributes imageWithText:ofItemType:forWidth:lineBreakMode:letterSpacing:textAlignment:style:withLegibilityStyle:legibilityStrength:] | -[UIStatusBarForegroundStyleAttributes drawText:forWidth:lineBreakMode:letterSpacing:textAlignment:style:textSize:textHeight:] | -[NSString(UIStringDrawingLegacy) _legacy_drawAtPoint:forWidth:withFont:lineBreakMode:letterSpacing:includeEmoji:] | -[NSAttributedString(NSExtendedStringDrawing) drawWithRect:options:context:] | __NSStringDrawingEngine | CTLineDraw | TRun::DrawGlyphs(CGContext*, CFRange) const | CGGStateSetFont | maybe_copy_text_state | malloc | malloc_zone_malloc
----
FREE  0x7fcbbd9345f0-0x7fcbbd934647 [size=88]: thread_10d8ae300 |start | main | UIApplicationMain | -[UIApplication _run] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoBlocks | __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ | __31-[FBSSerialQueue performAsync:]_block_invoke_2 | -[UIApplication workspaceDidEndTransaction:] | -[UIApplication _runWithMainScene:transitionContext:completion:] | -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:] | -[UIWindow _initWithOrientation:] | -[UIView init] | -[UIStatusBarWindow initWithFrame:] | -[UIWindow _initWithFrame:debugName:scene:attached:] | -[UIApplication _updateCurrentStatusBarViewControllerAppearance] | -[UIApplication _setStatusBarStyle:animationParameters:] | -[UIStatusBar _requestStyleAttributes:animationParameters:] | -[UIStatusBar _prepareToSetStyle:animation:] | +[UIView(Animation) performWithoutAnimation:] | __44-[UIStatusBar _prepareToSetStyle:animation:]_block_invoke | -[UIStatusBarForegroundView setStatusBarData:actions:animated:] | -[UIStatusBarForegroundView _setStatusBarData:actions:animated:] | -[UIStatusBarForegroundView _reflowItemViewsWithDuration:preserveHistory:] | -[UIStatusBarForegroundView _computeVisibleItemsPreservingHistory:] | -[UIStatusBarLayoutManager distributeOverlap:amongItems:] | -[UIStatusBarServiceItemView addContentOverlap:] | -[UIStatusBarServiceItemView updateContentsAndWidth] | -[UIStatusBarServiceItemView _contentsImageFromString:withWidth:letterSpacing:] | -[UIStatusBarForegroundStyleAttributes imageWithText:ofItemType:forWidth:lineBreakMode:letterSpacing:textAlignment:style:withLegibilityStyle:legibilityStrength:] | PopContext | CFRelease | context_finalize | CGGStackRelease | CGGStackReset | CGGStateRelease | free ALLOC 0x7fcbbd9345f0-0x7fcbbd9346e7 [size=248]: thread_10d8ae300 |start | main | UIApplicationMain | -[UIApplication _run] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoBlocks | __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ | __31-[FBSSerialQueue performAsync:]_block_invoke_2 | -[UIApplication workspaceDidEndTransaction:] | -[UIApplication _runWithMainScene:transitionContext:completion:] | -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] | -[UIWindow makeKeyAndVisible] | -[UIWindow _setHidden:forced:] | -[UIWindow addRootViewControllerViewIfPossible] | -[UIViewController view] | -[UIViewController loadViewIfRequired] | -[UIViewController loadView] | -[UIViewController _loadViewFromNibNamed:bundle:] | -[UINib instantiateWithOwner:options:] | -[UINib unarchiverForInstantiatingReturningError:] | -[UINibDecoder initForReadingWithData:error:] | -[UINibDecoder validateAndIndexData:error:] | -[UINibDecoder validateAndIndexObjects:length:] | calloc | malloc_zone_calloc
----
FREE  0x7fcbbd9345f0-0x7fcbbd9346e7 [size=248]: thread_10d8ae300 |start | main | UIApplicationMain | -[UIApplication _run] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoBlocks | __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ | __31-[FBSSerialQueue performAsync:]_block_invoke_2 | -[UIApplication workspaceDidEndTransaction:] | -[UIApplication _runWithMainScene:transitionContext:completion:] | -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] | -[UIWindow makeKeyAndVisible] | -[UIWindow _setHidden:forced:] | -[UIWindow addRootViewControllerViewIfPossible] | -[UIViewController view] | -[UIViewController loadViewIfRequired] | -[UIViewController loadView] | -[UIViewController _loadViewFromNibNamed:bundle:] | objc_object::sidetable_release(bool) | -[UINib dealloc] | objc_object::sidetable_release(bool) | -[UINibStorage dealloc] | objc_object::sidetable_release(bool) | -[UINibDecoder dealloc] | free ALLOC 0x7fcbbd9345f0-0x7fcbbd9346ff [size=272]: thread_10d8ae300 |start | main | UIApplicationMain | -[UIApplication _run] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoBlocks | __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ | __31-[FBSSerialQueue performAsync:]_block_invoke_2 | -[UIApplication workspaceDidEndTransaction:] | -[UIApplication _runWithMainScene:transitionContext:completion:] | -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] | -[UIWindow makeKeyAndVisible] | -[UIWindow _setHidden:forced:] | -[UIWindow addRootViewControllerViewIfPossible] | -[UIViewController view] | -[UIViewController loadViewIfRequired] | -[ViewController viewDidLoad] | _objc_rootAlloc | class_createInstance | calloc | malloc_zone_calloc
----
FREE  0x7fcbbd9345f0-0x7fcbbd9346ff [size=272]: thread_10d8ae300 |start | main | UIApplicationMain | -[UIApplication _run] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoBlocks | __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ | __31-[FBSSerialQueue performAsync:]_block_invoke_2 | -[UIApplication workspaceDidEndTransaction:] | -[UIApplication _runWithMainScene:transitionContext:completion:] | -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] | -[UIWindow makeKeyAndVisible] | -[UIWindow _setHidden:forced:] | -[UIWindow addRootViewControllerViewIfPossible] | -[UIViewController view] | -[UIViewController loadViewIfRequired] | -[ViewController viewDidLoad] | -[ViewController freeView:] | -[UIView dealloc] | -[UIResponder dealloc] | object_dispose | free zhangxuongdeMBP:images zhangxudong$ 

从这些输出中我们可以知道,堆这个内存的使用情况,从哪个方法中使用。他们的使用历史。

代码确实比较多,alloc(开辟地址) 和 free(释放地址) 成对出现 ,内存已经被释放了。注意最后一个free 有一句话 -[ViewController freeView:] 调用了个方法。之后 -[UIView dealloc] 。
现在已经确定了,问题所在。

OC中如何调试野指针异常(EXC_BAD_ACCESS(code = ....))相关推荐

  1. c语言编程中野指针错误,C程序中可怕的野指针

    一.疑问点 指针是C语言一个很强大的功能,同时也是很容易让人犯错的一个功能,用错了指针,轻者只是报个错,重者可能整个系统都崩溃了.下面是大家在编写C程序时,经常遇到的一种错误的使用方法,也许在你的学习 ...

  2. iOS监控-野指针定位

    点击上方"iOS开发",选择"置顶公众号" 关键时刻,第一时间送达! 野指针 当所指向的对象被释放或者收回,但是对该指针没有作任何的修改,以至于该指针仍旧指向已 ...

  3. HEAP: HEAP: Free Heap block xx modified at xxafter it was freed 堆内存出现野指针错误

    首先看下问题提示: HEAP[SimEng.exe]: HEAP: Free Heap block 000002CA51FC08A0 modified at 000002CA51FC0950 afte ...

  4. c语言野指针导致问题,C语言进阶之路(三)----野指针的产生原因及解决办法

    1.会产生野指针的做法 #include //这就是一种错误的写法 int main(){ int *p = NULL; p = (int *)malloc(); //释放P所指向的内存空间,但指针变 ...

  5. : EXC_BAD_ACCESS (code=EXC_I386_GPFLT)[r retain]: message sent to deallocated instance

    从一个页面退出的时候 遇到如图所示一个崩溃 遇到这种 EXC_BAD_ACCESS崩溃,首先想到野指针异常 然后 使用僵尸断点调试 如图 选中zombie objects ,开启僵尸断点调试 然后进行 ...

  6. GFlags调试堆中野指针

    我个人觉得写代码最悲哀的就是,程序的出错结果往往出人意料,并不在自己预期的错误列表中,其中堆中的野指针就是一个很隐蔽的问题.记得之前写了一个模块,后来因为功能升级,而修改了部分接口,等到运行的时候,老 ...

  7. C++中野指针问题分析总结

    其实项目一直被野指针困扰,一直在讨论,居然没有什么下文,下文正式由我接受这个问题. 场景是这样:指针间互相引用,一个被删除的时候,另外一个不知道,它再使用的时候就会异常,因为此时指针已经为空了. 我今 ...

  8. C和C++中的野指针问题

    文章目录 1 C和C++中的野指针问题 1.1 野指针的概念 1.2 野指针的由来 1.3 杜绝野指针的基本原则 2 C和C++中的常见内存错误 2.1 常见内存错误 2.2 内存操作的基本规则 1 ...

  9. c语言野指针和空指针,C++中的空指针和野指针

    空指针常量 一个表示0值的整数常量,叫做空指针常量.例如:0.0L.1-1(它们都是值为0的整数常量表达式)以及(void*)0.void* NULL 都是空指针常量,空指针常量可以赋值给任何指针类型 ...

最新文章

  1. 自制pyBoard的I2C实验,应用MicroPython
  2. python类的应用_Python · 元类(Meta Class)及其应用
  3. mysql的题_MySQL练习题
  4. 使用Spring Boot和Spring Security验证JWT
  5. 前端学习(2245)vue值造轮子之需求设计
  6. DirectSound学习笔记(4):设备性能
  7. Java中stringbutter_java 中String和StringBuffer与StringBuilder的区别及使用方法
  8. 定推【好处】篇,牵手定推,好处多多
  9. 如何开展分销渠道管理
  10. [linux内核] 3.系统调用处理过程
  11. 方维直播Android打包流程
  12. iOS开发实战之搜索控制器UISearchController使用
  13. FleaPHP 学习笔记1
  14. 6. 修改docker端口 (映射宿主机和docker容器中的端口)
  15. java申请暨资格审查表_毕业论文答辩申请暨资格审查表刘金花
  16. iOS CocoaPods1.0.0的一些基础知识
  17. 魔方内存盘的使用体验
  18. MP4 转换为 MP3 的工具
  19. 中断和异常 in 操作系统【操作系统学习笔记】
  20. 巴伦变压器电路图_宽带巴伦变压器

热门文章

  1. SpringBoot第十九篇:邮件服务
  2. java快拍_Java排序之快排
  3. 主控全志R16-京东叮咚TOP智能音箱拆解
  4. JAVA设计模式之工厂模式讲解
  5. 软件工程师是做什么的呢
  6. 什么时候发布华为鸿蒙os,华为鸿蒙OS什么时候发售 华为鸿蒙harmonyOS发布会配置价格上市时间-游侠手游...
  7. 标星1.3W!GitHub热榜第一,全网最牛掰的12306抢票神器
  8. mac、windows、centos、ubuntu 如何安装使用 docker 的?
  9. 白帽黑客入门,每天一个黑客技巧实现黑客的自我突破 !(附工具包)
  10. 游戏设计师与40种技巧