Cctype is generally used to process single character such as characters (if the character is a space output true value otherwise false) character transformation (case change)
String is basically the type of strings that can be
An array template class can generate a fixed-length array usage array< type name, number of elements > array name; Example: array<int,4>score={56,98,78,86}
A vector is a container class like a variable-length array vector< type name > array name (length) if the not-written length means that no member Vector.size can return the container length that is initialized after initialization can still be arbitrarily added delete
Iomanip is a function that controls input and output, such as stew (5) output five spaces and control the number of significant digits, etc.
Malloc.h is a dynamic storage allocation function header file that calls the relevant function when an operation is made to an internal store
- #include <malloc.h>= #include <alloc.h>
- Note: If the assignment succeeds, it returns a pointer to the allocated memory, otherwise the null pointer is null.
- Use the free () function to release memory blocks when memory is no longer in use.
Different points of malloc and new
New Returns a pointer of the specified type, and can automatically calculate the desired size . For example:
int *p;
p = new int; The return type is the int* type (integer pointer), and the allocation size is sizeof (int);
Or:
Int* Parr;
Parr = new int [100]; The return type is the int* type (integer pointer), and the allocation size is sizeof (int) * 100;
malloc must be computed by us to calculate the number of bytes and then forcibly converted to a pointer of the actual type after the return .
int* p;
p = (int *) malloc (sizeof (int));
-
The header file I encountered