1. The difference between a pointer and a reference
Answer: A, the pointer can be modified, the reference cannot be changed.
B, the pointer occupies memory, the reference does not occupy memory.
C, references cannot be null pointers can be null.
2. The difference between memcpy and strcpy
A: The strcpy will be copied to the/end string copy
memcpy is a memory copy
3. struct and class differences
A: By default, the access modifier is struct:public class:private
Default to inherit from struct is public
Storage type struct stored in the order of member declaration class cannot be saved
4, memory allocation method and the difference that is what the memory, what to do
A: heap, stack, code area, static storage (constant area)
Constant zone-"global variable, static variable, will be assigned at compile time
Stack-"Local variables, parameters, and function returns are all recorded in the stack
Heap area-"malloc Free new Delete programmer management
New malloc Difference
1. malloc is a function (cannot be overloaded) new is an operator (can be overloaded)
C + + Four modules comprise: 1, c 2, Object-oriented C + + 3, module C + + 4, STL
In a C + + program:
String C + + Standard library C + + standard library STL std:string header file
String.h C Standard Library
CString C standard library is adapted to the C + + standard
C + + Interview topic analysis