Parameters

The template struct describes various character traits for type CharType. The template class basic_string as well as several iostream template classes, including basic_ios, use this information to manipulate elements of type CharType. Such an element type must not require explicit construction or destruction. It must supply a default constructor, a copy constructor, and an assignment operator, with the expected semantics. A bitwise copy must have the same effect as an assignment. None of the member functions of struct char_traits can throw exceptions.

Return Value

The EOF character.

Remarks

A value that represents end of file (such as EOF or WEOF).

The C++ standard states that this value must not correspond to a valid char_type value. The Visual C++ compiler enforces this constraint for type char, but not for type wchar_t. The example below demonstrates this.

The char_types and corresponding int_types are:
ch1 = x corresponding to int1 = 120.
ch2 = y corresponding to int1 = 121.
ch3 = x corresponding to int1 = 120.
The int_type representation of character ch1
is not equal to the int_type representation of ch2.
The int_type representation of character ch1
is equal to the int_type representation of ch3.

The string to be searched is: f2d-1234-abcd
The character searched for in s1 is: d
The string beginning with the first occurrence
of the character 'd' is: d-1234-abcd
The result2 of the search is NULL.

Remarks

The type is a signed integer that describes an object that can store a byte offset involved in various stream positioning operations. It is typically a synonym for streamoff, but it has essentially the same properties as that type.

Remarks

The type describes an object that can store all the information needed to restore an arbitrary file-position indicator within a stream. It is typically a synonym for streampos, but in any case it has essentially the same properties as that type.

The char_types and corresponding int_types are:
ch1 = a corresponding to int1 = 97.
ch2 = b corresponding to int1 = 98.
ch3 = a corresponding to int1 = 97.
The recovered char_types and corresponding int_types are:
recovered ch1 = a from int1 = 97.
recovered ch2 = b from int2 = 98.
The recovered char_type of ch1 is equal to the original ch1.
The recovered char_type of ch2 is equal to the original ch2.

The char_types and corresponding int_types are:
ch1 = a corresponding to int1 = 97.
ch2 = b corresponding to int1 = 98.
ch3 = a corresponding to int1 = 97.
The recovered char_types and corresponding int_types are:
recovered ch1 = a from int1 = 97.
recovered ch2 = b from int2 = 98.
The recovered char_type of ch1 is equal to the original ch1.
The recovered char_type of ch2 is equal to the original ch2.