[Interview] Interview sprint

Between immediately go to the interview, or to study intensively cpp it.

  • Vtable
  • Virtual destructor
  • map
  • sort/qsort
  • lockstep
  • ecs
  • Use memset to initialize a class cause class virtual function table pointer and problems. Related Links
  • Used memset(a,1,sizeof(a))to initialize the array is not a desired effect, as will memset each byte value of 1 becomes 16,843,009.
  • sizeof during compilation is converted to the corresponding number (although hear a standard representation, in order to meet some dynamic array may be calculated at run time), so please do not use the function pointer type sizeof calculate the size parameter, it returns a pointer length, instead of the pointer address length (arrays, structures, classes).
  • sizeof calculates the end of the string \0, and strlen will not.
  • C storage location change may occur when the vector adding new elements, the entire vector is launching a mobile location.
  • C ++ constant folding Click
  • const modified read-only variables were expressed as (c), and is expressed as a constant in C ++.
  • const initialization constant while the assignment.
  • , (Comma operator)//TODO
  • Its structure//TODO
  • Virtual function call problem//TODO
  • virtual functions are dynamically bound, but default parameter values ​​is static binding. Never redefine the default parameter values ​​inherited!

Guess you like

Origin www.cnblogs.com/jhy16193335/p/11582623.html