adding the two string function notes
This commit is contained in:
@@ -227,7 +227,7 @@ In this assignment, we define that a child comment should be indented by four sp
|
||||
jsonFile.close();
|
||||
```
|
||||
|
||||
After these lines, the whole content of the json file will be stored as a string in the std::string variable *json_content*. And you can then parse it to get each individual comment. In order to parse the *json_content*, which is a std::string, you will once again find that the std::string functions such as *std::string::find*(), and *std::string**substr*() to be very useful.
|
||||
After these lines, the whole content of the json file will be stored as a string in the std::string variable *json_content*. And you can then parse it to get each individual comment. In order to parse the *json_content*, which is a std::string, you will once again find that the std::string functions such as *std::string::find*(), and *std::string::substr*() to be very useful.
|
||||
|
||||
2. **The second input file** contains comments, which may have spaces, and that makes it hard for you to use the >> operator to read the content of the file. Once again, the *getline* function can come into play. Let's say you want to read a line like this:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user