码迷,mamicode.com
首页 > 编程语言 > 详细

Modern C++ Course [Lecture 6] {Static, Numbers in memory, Raw C arrays, Non-owning pointers, Classes in memory}

时间:2018-12-31 14:40:51      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:stat   alt   length   als   ati   null   ima   分享   set   

技术分享图片

 

 

every object of the same class can equally gets access to the static variable

 技术分享图片

 

 

 

技术分享图片

 

float has limited precision, eg, float x = 1.0;

but x = 0.99999987 things like this.

 

技术分享图片

 

 

 技术分享图片

 

 技术分享图片

 

 技术分享图片

 

 技术分享图片

 

 

技术分享图片

destroy precision of demicals when add huge numbers to small numbers

 

 

技术分享图片

 

 技术分享图片 set precision(20)

10M + PI

 

 技术分享图片

1M + PI

length of decimal part is nonlinear....???

 

技术分享图片

 

 

技术分享图片

there‘s no way of knowing in the function what‘s the size of the array you are passing.

and you can read any memory you want and this is dangerous

 

技术分享图片

 

 just make it a rule, never ever create a pointer without initialization.

 if a nullptr is used without further declaration, compiler would show you a "segmentation error"

 

 

技术分享图片

 

 

技术分享图片

 

 

 

   技术分享图片

 

 技术分享图片

 

 

 

技术分享图片

 

 

技术分享图片

custom objects have variables in memeory stored together, but some padding may be inserted.

 

Modern C++ Course [Lecture 6] {Static, Numbers in memory, Raw C arrays, Non-owning pointers, Classes in memory}

标签:stat   alt   length   als   ati   null   ima   分享   set   

原文地址:https://www.cnblogs.com/ecoflex/p/10201933.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!