new Returns the address of new space
allocated for a dynamic variable of the
type named on the right
delete Returns the space allocated for the
dynamic variable on the right to the heap
to be allocated again
selection . (infix: struct variable.member) Accesses
the member field of the struct variable
. (infix: class variable.member) Accesses
the member data or function of the
class variable
[] (postfix: encloses an integral expression)
Accesses a position within the array
variable named on the left
scope resolution :: (infix: class type::method) Associates a
method with the class in which it is
declared
Appendix D
C++ Library Routines and Constants
Header File cctype
isalnum(ch) Returns true if ch is a letter or a digit; false otherwise.
isalpha(ch) Returns true if ch is a letter; false otherwise.
iscntrl(ch) Returns true if ch is a control character; false, otherwise.
isdigit(ch) Returns true if ch is a digit; false otherwise.
isgraph(ch) Returns true if ch is a nonblank printable character; false
otherwise.
islower(ch) Returns true if ch is lowercase; false otherwise.
isprint(ch) Returns true if ch is a printable character; false otherwise.
ispunct(ch) Returns true if ch is a nonblank printable character (i.e., not a
letter or a digit); false otherwise.
isspace(ch) Returns true if ch is a whitespace character; false otherwise.
isupper(ch) Returns true if ch is an uppercase letter; false otherwise.
toupper(ch) Returns ch in uppercase regardless of original case.
tolower(ch) Returns ch in lowercase regardless of original case.
Appendix D | 469
78828_APPX_DaleLab 5/29/09 11:27 AM Page 469
Header File string
str.c_str() Converts string object str to a C string.
str.find(str2) Searches str for str2. If found, returns the character position in str
at which the match begins. If not found, returns npos, the largest
value within the return value type of the function.
str.length() Returns the number of characters in str.
str.size() Returns the number of characters in str.
str.substr(pos, len) Returns a substring of the object str beginning at the position pos
and continuing until the substring is len characters or the end of
str is reached. If the beginning position is outside the string, the
program crashes.
getline(inData, str) Reads and collects characters into str until a newline character is
encountered. The newline character is read but not stored in str.
Header File cstring
cstrcat(s1, s2) Returns the base address of s1 with s2 concatenated on
the end.
cstrcmp(s1, s2) Returns a negative integer if s1 comes before s2; returns zero if s1
is equal to s2; and returns a positive integer if s2 comes before s1.
cstrcpy(s1, s2) returns the base address of s1 with s2 copied in it.
cstrlen(s) Returns the number of characters in s.
Header File cstddef
NULL The system-dependent null pointer constant (usually 0).
Header File cfloat
FLT_DIG Approximate number of significant digits in a float value on your
machine.
FLT_MAX Maximum positive float value on your machine.
FLT_MIN Minimum positive float value on your machine.
DBL_DIG Approximate number of significant digits in a double value on
your machine.
DBL_MAX Maximum positive double value on your machine.
DBL_MIN Minimum positive double value on your machine.
LDBL_DIG Approximate number of significant digits in a long double value
on your machine.
LDBL_MAX Maximum positive long double value on your machine.
LDBL_MIN Minimum positive long double value on your machine.
470 | Appendix D
78828_APPX_DaleLab 5/29/09 11:27 AM Page 470
Appendix D | 471
Header File climits
CHAR_BITS Number of bits in a byte on your machine.
CHAR_MAX Maximum char value on your machine.
CHAR_MIN Minimum char value on your machine.
SHRT_MAX Maximum short value on your machine.
SHRT_MIN Minimum short value on your machine.
INT_MAX Maximum int value on your machine.
INT_MIN Minimum int value on your machine.
LONG_MAX Maximum long value on your machine.
LONG_MIN Minimum long value on your machine.
UCHAR_MAX Maximum unsigned char value on your machine.
USHRT_MAX Maximum unsigned short value on your machine.
UINT_MAX Maximum unsigned int value on your machine.
ULONG_MAX Maximum unsigned long value on your machine.
78828_APPX_DaleLab 5/29/09 11:27 AM Page 471

Get A Laboratory Course in C++, 5th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.