I\'ve just started learning C++ using Programming: Principles and Practice using C++. That book tells me to use a header file which sets things up for me. The header file in que
(Are you sure that's the code you're compiling? where is max declared?)
std::vector is a very strange beast which doesn't behave like std::vector for any other T.
Unfortunately even though std::vector seems like the obvious choice in your case, it forces you to deal with the oddness of std::vector and it doesn't work with Stroustrup's Vector class template.
The detailed explanation of the error is that Stroustrup's header re-defines vector to refer to his Vector template, which adds some range-checking to the element access operator (i.e. operator[], which is the one used when you say primes[i]). The redefined vector cannot be instantiated with bool because std::vector does not return a normal reference, and the redefined vector expects it to do so.