String Exercise 1: Learn and Practice
The code in this exercise is the starting point for the next exercise, so learn it well.
Use file name ex3_stringA.cpp
copy the following code into your Visual Studio or other IDEs:
The purpose of the program is to learn and practice the
.length()
, .find()
and .substr()
string functions by:
- Reading the code carefully
- Adding 2 lines of code as indicated in the comments.
- Compiling and running this C++ program to observe the results
When you are done:
- Take a screenshot of your IDE and console window after running the program.
- For this exercise, you will have:
ex3_stringA.cpp
. - Complete all the exercises in this lab and upload the .cpp files and the screen captures for the output.