- . , vtable, , . , , vtable. vtable , . , , , , , .
- , . , - , vtable.
vtable . . vtable ; . vtable .
,
3 , , .. .
- , .
- , .
- . , .. , .
, , , .
- . -. - (iostream).
:
#include <stream.h>
main()
{
cout << "Hello, world\n";
}
#include <stream.h> , , stream.h. cout << "Hello, world\n" . << (" ") ( , "Hello, world\n" cout). C << . << , << , .
|
|
>> (" ") cin. cin >>, , <stream.h>. << , .
- ++ . , .
istream , ostream . iostream.h. - : cout,cin cerr. cout , cin , cerr . cout cerr ostream, cin istream . cout cerr Unix . .
<<, >>.
cout << " : " << 34;" ", 34.
int x;cin >> x;x. (, , , - .)
<< >>
iostream >> << ++ ( char*). , , .
String, <<, -, String, . String, ostream. , ostream, ostream, , . << , , :
-, << . , .
. istream ++ . , , , , >> friend.
- ANSI-C. .
- .
- - .
- ( ):
- basic_istream, basic_ostream - , ;
- basic_ifstream, basic_iostream - ;
- basic_istringstream, basic_ostringstream - -.
- , , / .
- basic_ios ( ) basic_streambuf ( ) :
- (charT) ;
- (traits) - ios_traits ( ), , ;
- char wchar_t ios_traits .
.
|
|
++.
++ : ios streambuf.
streambuf -, , -. streambuf . -. .
ios - .
(istream, ostream, iostream) . (istrstream, ostrstream, strstream) - , . (ifstream, ofstream, fstream) .
ios
streambuf
istream
ostream
iostream
iostream_withassign
istrstream
ostrstream
strstream
ifstream
ofstream
fstream
, , .
iostream.h - ios, ostream, istream.
strstream.h - strstream, istrstream, ostrstream.
fstream.h - fstream, ifstream, ofstream.