.


:




:

































 

 

 

 


.




- . , vtable, , . , , vtable. vtable , . , , , , , .

- , . , - , vtable.

vtable . . vtable ; . vtable .

,

3 , , .. .

  1. , .
  2. , .
  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 .

.

template<class charT, class traits = ios_traits<charT> >class basic_istream: virtual public basic_ios<charT, 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.






:


: 2016-07-29; !; : 586 |


:

:

, .
==> ...

1844 - | 1647 -


© 2015-2024 lektsii.org - -

: 0.016 .