... integers,
althoughtheyaremostoftenusedincomparisonswithothercharacters.
Certain characters can be represented in character and string constants by escape sequences
like
\n
(newline); these sequences look like two characters, ... etc.,
formacontiguousincreasingsequence.
Another example of
char
to
int
conversion is the function
lower
, which maps a single
character to lower case...
... recursive version of the function
reverse(s)
, which reverses the
string
s
inplace.
4.11The C Preprocessor
C provides certain language facilities by means of a preprocessor, which is conceptionally ... input.
Should
ungets
knowabout
buf
and
bufp
,orshoulditjustuse
ungetch
?
Exercise 4-8. Suppose that there will never be more than one character of pushback. Modify
getch
an...
... file
orerror.
putc
isanoutputfunction:
intputc(int c, FILE*fp)
putc
writes the character
c
to the file
fp
and returns the character written, or EOF if an error
occurs.Like
getchar
and
putchar
,
getc
and
putc
maybemacrosinsteadoffunctions.
When ... which are expected to match the next non-white space
characteroftheinputstream.
129
•
Conversion specifications,...
... no
special access rights to members of an enclosing class.
[class.local] 9.9 Local class declarations
1 A class can be defined within a function definition; such a class is called a local class. The ... operator cannot bind to a volatile lvalue;
see C. 2.8.
12.8 Copying class objects DRAFT: 28 April 1995 Special member functions 12– 17
[class.copy] 12.8 Copying class objects
1 A class objec...
... suffix
1 To decide if the character
c
is a whitespace character, the function performs ‘‘as if’’ it executes the follow-
ing code fragment:
ctype<charT> ctype = getloc().use<ctype<charT> ... object.
[lib.istringstream.cons] 27. 7.2.1 basic_istringstream constructors
explicit basic_istringstream(ios_base::openmode
which
= ios_base::in);
Effects: Constructs an object of class b...
... changed, and so can the object pointed to by cp. Examples of some correct operations are
i = ci;
*cp = ci;
pc++;
pc = cpc;
pc = p;
ppc = &pc;
Examples of ill-formed operations are
7 20 Declarations ... objects shall be objects of previously defined classes. In partic-
ular, a class cl shall not contain an object of class cl, but it can contain a pointer or reference to an object
of cla...