.
:
-
-
-
-
class Node
{Type d;
Node *p};
.
()
()
:
- ( )
-
-
- ( )
-
-
( ) ,
template < >
:
- ( )
- ,
- , , ,
-
_ <> _ [(_)]
List <int> list1;
List <double> list2;
list1.add(2);
list2.print;
32) ++. . .
, .
++ , .
: , , ,
,
-
:
try
{, }
throw [];
catch ( ) { }
catch () { }
catch () { }
.
++ :
1) throw , ,
2) ; ,
3) , ,
, throw:
|
|
- , catch
- catch
- , catch
:
void f1() throw(int, char*)
{ }
void f2() throw()
{ }
:
class Vector
{public:
const int max=200;
Vector(int n)
{if(n<0 || n>max) throw invalide size;
}};
try
{ Vector *p=new Vector(400);}
catch(char*) {}
33) . ++.
( ) .
namespace [_] {/**/}
namespace demo
{int i=1; int k=0;
void func(int);
void func2(int) {/**/}}
void demo::func(int) {/**/}
demo::i=100;
demo::func2(10);
using demo::i; //
using namespace demo;
++:
- , , .
- , ++
:
- ( )
- ( )
- ( )
- ( )
- ( )
.
34) ++.
:
-
-
-
, :
-
-
-
:
ios streambuf
istream ostream
iostream
.
istream cin; ()
ostream cout; ()
ostream cerr;
ostream clog;
istream ostream (<<) (>>).
-
-
-
-
:
get
getline ,
read
seekg
put
write