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

 

 

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.

 

posted @ 2018-12-31 13:42  ecoflex  阅读(120)  评论(0编辑  收藏  举报