
Jumping into C++

The STL has a replacement for the array, called the vector.
Alex Allain • Jumping into C++
name_to_email[ "Alex Allain" ] = "webmaster@cprogramming.com";
Alex Allain • Jumping into C++
map<string, string>::iterator itr = name_to_email.find( "Alex Allain" );
Alex Allain • Jumping into C++
The newline itself will be discarded—your input will contain everything up to the newline,
Alex Allain • Jumping into C++
for ( vector ::iterator itr = vec.begin(); itr != vec.end(); ++itr )
Alex Allain • Jumping into C++
file. The method eof will indicate if you’re at the end of the file.
Alex Allain • Jumping into C++
In general, it is quite easy to write a recursive algorithm as a loop, and vice versa, when you don’t need to do anything with the result that comes from calling the recursive function. This is called tail recursion—when the recursive call is the last thing the function does, at
Alex Allain • Jumping into C++
name_to_address.size();
Alex Allain • Jumping into C++
using namespace std;