String parsing, is a string into, multiple strings out.
More broadly speaking is a string into, a data structure variable out.
A broader understanding is the flow of information.
The simplest command to parse a character is scanf. It embodies the important thought.
But the scanf is inflexible and inflexible, and when the actual need is not met,
You need to write your own parsing function, and here's an analysis of the key steps of parsing:
A: Find key characters or strings: (Other Keywords: index, indexof, etc.)
/C/STRCHR, STRSTR,
/C + +/Find, find_first_of, find_last_of
B: Extract string: (Other keywords, left,right, mid, etc.)
/c/strcpy, strncpy
/C + +/substr
C has a split function that can be used to convert a single string to multiple strings,
But you can't return it as an array (be sure to use an array, just a pair of shoes itching suspicion, not concise)
Instead, you use a while loop operation. Process a string at a time.
C: The string is converted to numeric values. (Other keywords: toint tolong toascii, etc.)
/C/atoi, STR2
/c++/has workflow based operations, complete type conversion << >>
This implements the split up and splits the string into different structural variables
Application:
A. Splits the string into arrays, thus turning the input into a different array of parameters (params)
1. Find the flag character or string.
2. Extract String.
3. Storing in array
C + + has a dynamic array (vector), dynamic list (list), eliminating the allocation of maintenance of the array of annoyance.
B. Split key value pairs.
1. Divide the string into 2 strings based on the delimiter,
One for key and one for value.
As for merging strings, it is more broadly a struct for input and a string for output.
It's easier, I call it a get operation, and the front parse can also be called a set operation
/c/sprintf, strcat,strcpy
/c++/+, sstream operation.
C + + String class has a very good string operation code, additions and deletions to check all over, pay attention to its header file code
The above is a broad understanding of get/set.
The analysis of binary data will further involve more technology.