Reference: The C++ Standard Library
Monday, August 30, 2010
Is char a Signed Type
std::numeric_limits<char>::is_signed tells you if char is a signed type or not.
Reference: The C++ Standard Library
by Nicolai M. Josuttis. Addison-Wesley, 1999, p. 61-62.
Reference: The C++ Standard Library
Saturday, August 28, 2010
NULL
A C NULL is (void*)0, a C++ NULL is 0.
Reference: The C++ Standard Library: A Tutorial and Reference
by Nicolai M. Josuttis. Addison-Wesley, 1999, p. 71.
Reference: The C++ Standard Library: A Tutorial and Reference
Thursday, August 26, 2010
atexit() Function
Functions registered by atexit() are executed in reverse order when a program ends.
If exit() is called, these functions are still called.
If abort() is called, these functions are not called.
Reference: The C++ Standard Library
by Nicolai M. Josuttis. Addison-Wesley, 1999, p. 71.
If exit() is called, these functions are still called.
If abort() is called, these functions are not called.
Reference: The C++ Standard Library
Wednesday, August 25, 2010
Tertiary Operator
Given:
int x = 0; int y = 0;Then:
(1 ? x : y) = 4;Sets x to 4.
Tuesday, August 24, 2010
String's push_back() Member Function
The string container has a push_back() member function.
Reference: The C++ Standard Library
by Nicolai Josuttis. Addison-Wesley, 1999, p. 81.
Reference: The C++ Standard Library
Sunday, August 22, 2010
Incrementing an Insert Iterator
Incrementing an insert iterator is a NO OP.
Reference: The C++ Standard Library
by Nicolai M. Josuttiis. Addison-Wesley, 1999, p. 104.
Reference: The C++ Standard Library
Friday, August 20, 2010
Vector at() Function
If you have a vector v; v.at(10) will do range checking, while v[10] will not.
Reference: The C++ Standard Library
by Nicolai M. Josuttis. Addison-Wesley, 1999, p. 152.
Reference: The C++ Standard Library
Subscribe to:
Posts (Atom)