Using if In A Search Statement
Let's test the 'if' statement feature we discussed in the last lesson.
We'll cover the following...
We'll cover the following...
We learned that C++17 allows us to specify a new variable which can be used in the condition. This variable is inside the if condition scope:
Let’s see if this is useful. Say you want to search for a few things in a string:
As you can see, you have to use different names for pos or enclose it with a separate scope, otherwise the code will fail as it does ...