1, for char* or char[] defined string, often have splicing, interception, replication and a series of operations. Specific functions can refer to the online reference. It is worth noting that the original functions were discarded after vs2013, and the functions were redefined in a function_s way, increasing the control over the size of the data and preventing overflow.
For example:
Original--strcat (char* dest,char* src)
Now--strcat_s (char* dest,sizeof (dest), char* src)
2, there is one notable problem that always makes mistakes is the re-assignment of strings.
For strings (no matter what type, here is a char example)
For example:
Char b[]= "234"; //This is possible, is the initialization of the assignment
However, the re-assignment is not allowed,
For example b= "567"; Error! Because B is the first address of the array, the system allocates memory to him as "234", which is a pointer constant and cannot be re-assigned.
Need to adopt:
The 1,strcpy_s function, strcpy_s (s, 200, "234"), where S is best represented as char [], facilitates the definition of buffer size.
2, Will char[]-->char*
String manipulation functions and re-assignment problems