[Home Page] - [Reviews Main] | |
|
Object-Oriented Software in ANSI C++ by Michael Smith Not Recommended |
| ISBN: 0 07 709504 9 Publisher: McGraw-Hill Pages: 474pp Price: £24.99 |
| Categories: beginner's c++ object oriented |
| Reviewed by Yechiel M. Kimchi in C Vu 12-3 (May 2000) |
#include
<math> instead of <cmath> or <math.h>.
Here are some additional confusing examples
std::cin>>std::resetiosflags( std::ios::skipws );
while(std::cin >> ch, !std::cin.eof()){
std::cout << ch;
}
std::cin is used all over the book. Nowhere could I find the
directive using namespace std; not even in the chapter dealing with
namespaces.
eof() is not a bug here, only because ch is of type
char. I easily found a similar piece of code which was buggy (p.
402)
int num;
while(cin>>num, !cin.eof()) {
// whatever
}
std::cin? Because here, cin is a local variable!
cin is istrstream, a type designated by the standard
as depreciated.More examples of errors can be found on my page http://www.cs.technion.ac.il/users/yechiel/CS/BadBooksC+C++.html#OOSCPPsmith
To link to this review, please use the URL: http://www.accu.org/bookreviews/public/reviews/o/o002119.htm
Copyright © The Association of C & C++ Users 1998-2000. All rights reserved.