ebook55-1
|
|
- 黠 毕
- 7 years ago
- Views:
Transcription
1 1 O O P O O P C + + [1] S i m u l a - 67 O O P O O P S m a l l t a l k C++ O O P [1] The Tao of Objects Gary Entsminger
2 2 C O O P O O P
3 v i r t u a l v i r t u a l C + + Vi r t u a l OOP C C++ C C + + m a i n () C C + + C 1.2 C++ C + + C O O P C O O P C C C C + + O O P C + + C + + C C C + + C C + +
4 4 C + + C + + r e f e r e n c e s ( ) C C + + C C + + C C + + C C + + C C + + C + + C C + + C + + C 10 % O O P C C + + C
5 C C B A S I C C C B A S I C C + + h e l l o - w o r l d O O P 1.3 O O P C + + C + + C ) 2)
6 6 C C F O RT R A N F O R m u l a - T R A N s l a t i o n C O B O L COmmon Business-Oriented Language L i s p L i s t - P r o c e s s i n g A P L A Programming L a n g u a g e L i s p A P L m i s s i o n F O RT R A N C O B O L F O RT R A N C O B O L A l g o l P a s c a l P r o l o g F O RT H F O RT H B A S I C Beginners All-purpose Symbolic Instruction Code 60 A P L B A S I C A P L
7 F o o b l e B l a h 1.
8 8 C + + 1) 2) % 2 0 % 20 % 3. OOP O O P O O P
9 O O P O O P O O P [ 1 ] 1) 2) 3) 4) 5) 1) 2) 3) 4) 5) [1] Design Patterns:Elements of Reusable Object-Oriented Software by Erich Gamma et al., Addison-We s l e y, 1995
10 10 C O O P C + + [ 1 ] 2. O O P C + + 1) 2) [1] A reference to vampires made in The Mythical Man-Month, by Fred Brooks, Addision-We s l e y, 1975
11 ) 2) 3. 1) 2) 3) 4) 5) C + + O O P 6) 7) 4. Michael Wi l k O O P 5.
12 12 C + + Software Creativity Robert Glass P r e n t i c e - H a l l, 1995 G l a s s P. J. P l a u g e r [ 1 ] Pe o p l e w a r e Tom Demarco Timothy Lister Dorset House,1987 X Y Z C o m p l e x i t y, M. Mitchell Wa l d r o p Simon & Schuster, 1992 Santa Fe, New Mexico 1.4 Robert McKee [2] M c K e e [1] Object Lessons Tom Love, SIGS Books, 1993 [2] Through Two Arts, Inc.,12021 Wilshire Blvd. Suite 868, Los Angeles, CA 90025
13 ) C + + 2) C + + D B M S D B M S w i l d - c a r d [ 1 w i l d - c a r d ] w i l d - c a r d w i l d - c a r d w i l d - c a r d O O P B r o o k s [2] O O P [1] w i l d - c a r d [2] The Mythical Man-Month,
14 14 C + + O O P [ 1 ] C + + [ 2 ] (treatment) [1] Microsoft Wo r d [2]
15 derived:public base O c c a m s Razor 3. o o p o o p
16 16 C main( ) main( ) 2. 1) 2) 3) / / # [ 1 ] // #[2] Rich Text Format(RT F ) 4) 5)
17 # i n c l u d e m a i n () A B C m a i n () [ 1 20 ] [1] Object Analysis and Design:Description of Methods, edited by Andrew T. F.Hutt of Object Management Group(OMG),john Wiley & Sons, 1994
18 18 C Booch B o o c h [1] O O P CRC Class, Responsibility, Collaboration, CRC) B o o c h / C R C [1] Object-Oriented Design with Applications by Grady Booch, Benjamin Cummings, C + +
19 RDD [1] C R C B o o c h R D D R D D 1) 2) 3) 4) OMT [ 2 ] O M T B o o c h R D D O M T 1) B o o c h R D D 2) 3) 1.6 OOP O O P O O P C C OOP O O P C C 6 9 [1] Designing Object-Oriented Software by Rebecca Wirfs-Brock et al., Prentice Hall, 1990 [2] Object-Oriented Modeling and Design by James Rumbaugh et al., Prentice Hall,1991
20 20 C O O P C [1] 4. C + + m a i n ( ) O O P C C + + C + + C C + + C + + O O P C + + C C + + O O P C C + + C + + [1] Camma et al.,
21 1 21 C O O P O O P C + + C + + C C % C + + C C++ C C C + + C C + + C C O O P C + + O O P 1.7 C + + O O P C + + O O P O O P O O P C + + O O P C + + C + C + + C + +
22
23 2 C + + C L I B L I B U N I X Wi n d o w s D D L D D C + + C C A int A e x t e r n e x t e r e x t e r n
24 2 23 int f(float,char); f C + + C C + + g r e p a w k 2.2 C C C s t r u c t s t r u c t C s t r u c t s t r u c t s t a s h
25 24 C + + s t r u c t s t r u c t C t y p e d e f s t r u c t s t r u c stash A, B, C; C C C s t o r a g e unsigned char* C s t a s h v o i d * O B J L I B D D L
26 2 25 #include #include
27 26 C + + initialize( ) struct stash s t o r a g e size add( ) s t a s h inflate( ) v o i d * C memcpy( ) memcpy( ) &(S->storage[S->next * S->size]) n e x t & memcpy( ) n e x t fetch( ) fetch( ) add( ) C count( ) struct stash i n t S t a s h i n t S t a s h. n e x t c o u n t (& i n t S t a s h ) s t a s h s t r u c t n e x t n e x t s t a s h s t o r a g e 200 a i r p l a n e 20 C malloc( ) calloc( ) realloc( ) free( ) inflate( ) realloc( ) s t a s h realloc( ) initialize( ) realloc( ) assert( ) malloc( ) calloc( ) realloc( ) C free( ) Microsoft Wi n d o w s
28 2 27 assert( ) A S S E RT. H assert( ) C 17 C + + free( ) free( ) malloc( ) calloc( ) realloc( ) cleanup( ) s t a s h i n t 80
29 28 C + + main( ) s t a s h i n t S t a s h s t r i n g S t a s h L I B T E S T.C stringstash C s t a s h fopen( ) FILE struct FILE struct fgets( ) fclose( ) FILE struct s t r u c t C s t a s h i n t S t a c f o r count( ) s t r i n g S t a s h w h i l e fetch( ), C C C i n t i n t LIB.H stash C C void foo(float) i n t f l o a t.o.obj L I B T E S T.C initialize( ) fetch( ) ( ) LIB.C, L I B T E S T.C
30 2 29 C f o o ( i n t ) f o o ( f l o a t ) _ f o o _ f o o foo( ) i n t foo( ) f l o a t f l o a t 2.3 c p p : cpp libtest.c lib.c U N I X make m a k e [1] make make make makefile makefile m a k e f i l e C. h.c C++ Unix.H.C M S - D O S DOS C++.hxx. c x x C C + +. c p p. h 2.4 stash C [1] C++ Inside & Out, (Osborne/McGraw-Hill,1993)
31 30 C + + C C initialize( ) cleanup( ) C C C initialize( ) cleanup( ) stash_initialize( ) stash_cleanup( ) struct s t r u c t C + + struct s t r u c t struct 2.5 C + + stash // C C C + + //
32 2 31 t y p e d e f C + + t y p e d e f i n t c h a r f l o a t d o u b l e stash s t r u c t C C + + C stash A, B, C; add( ) C stash_initialize( ) stash_cleanup( ) struct stash initialize( ) initialize( ) initialize( ) struct stash s t r u c t C + + :: struct initialize( ) s t a s h stash::initialize(int Size, int Quantity) stash C + +
33 32 C + + C++ C struct s->size = size size = size s - > C++ C + +
34 2 33 C S stash* C + + t h i s s t r u c t C S C this->size = Si z e ; t h i s C inflate( ) v o i d * S->storage = v; C++ C v o i d * malloc( ) calloc( ) realloc( ) C C + + C + + C + + s t r u c t C++ s t r u c t s t r u c t C + + v o i d * void* void* void* calloc( ) realloc( ) unsigned char* C + + C C C C++ C C++ C C++ C C + + C C + + stash C + +
35 34 C + +. this C + + intstash.initialize(sizeof(int), 100) s t a s h _ i n i t i a l i z e (& i n t S t a s h, sizeof(int), 100) C + + c f r o n t AT & T C C c f r o n t C + + C C++ while(cp = (char*)stringstash.fetch(i++)) C C++ C
36 2 35 C struct O O P O O S i m u l a S c a n d i n a v i a S i m u l a Simula class C++ o b j e c t - b a s e d C [ 1 ] f l o a t float int stash add( ) fetch( ) inflate( ) stash S s t a s h float f float stash s t a s h abstract dada type C + + s t a s h stash o b j e c t. m e m b e r _ f u n c t i o n ( a rg l i s t ) stash S S. a d d (& i ) S add( ) C C C C s t r u c t C struct C++ C C + + C [1]
37 36 C + + struct s i z e o f struct 200 int struct B s t r u c t C C++ s t r u c t printf () sizeof C++ C C C C C++ C P P
38 2 37 C P P C C++ C++ C++ F O O. H FOO.H #ifndef FOO_H_ #define FOO_H_ // Rest of header here... #endif // FOO_H_ C C++ main( ) 2.10
39 38 C + + struct l i n k link link next head struct link link* head C initialize( ) stack initialize( ) cleanup( ) push( ) pop( ), d a t a data peek( ) data cleanup data
40 2 39 struct stack::link::initialize( ) stack::initialize( ) head stack::push( ) stack malloc( ) link l i n k initialize( ) link next h e a d head link link stack::pop( ) data head stack::cleanup( ) cursor free( ) l i n k d a t a link
41 40 C + + A A
42 2 41 S::f( ) f( ) A 2.11 C++ C + + struct ) struct 2) 3) 4) 5) C++ struct typedef
43
44 3 C C + + s t r u c t s t r u c s t r u c t t y p e d e f C + + s t r u c t 3.1 C s t r u c t s t r u c i n i t i a l i z e () c l e a n u p () s t r u c t C s t r u c t s t a c k malloc() 3.2 C++ C + + s t r u c t p u b l i c p r i v a t e p r o t e c t e d s t r u c t p u b l i c p u b l i s t r u c t s t r u c t
45 3 43 p r i v a t e p r i v a t e struct B
46 44 C + + f o o () B m a i n () s t r u c t s t r u c t protected) p r o t e c t e d p r o t e c t e d p r i v a t e p r o t e c t e d p r i v a t e s t r u c t s t r u c s t r u c t s t r u c t
47 3 45 struct Y f( ) X C + + struct Y Y :: f(x*) struct X Y :: f(x*) struct X Y :: f(x*) X X Y :: g(x) X Y :: f(x*) struct X X s t r u c t, struct X Y :: f(x*) Y g( ) g( f r i e n d s t r u c t s t r u c t :friend struct Z s t r u c t s t r u c t s t r u c t
48 46 C + + s t r u c t f r i e n d
49 3 47 struct holder p o i n t e r, p o i n t e r p o i n t e r h o l d e r s t r u c t p o i n t e r h o l d e r friend holder : :pointer ; s t r u c t p o i n t e r p o i n t e r h o l d e r main( ) p o i n t e r C h o l d e r
50 48 C f r i e n d C + + f r i e n d C C s t r u c t C + + s t r u c t C + + C struct C s t r u c t C + + C + + C C + + s t r u c t s t r u c t C C + + s t r u c t 3.5 s t r u c t p r i v a t e C s t r u c t S i m u l a - 67 c l a s s S t r o u s t r u p C + +
51 3 49 C s t r u c t c l a s s C + + s t r u c t c l a s s s t r u c t p u b l i c C + + c l a s s c l a s s S t r o u s t r u p s t r u c t s t r u c t p u b l i c
52 50 C + + m X Y x m stash 2
53 3 51 i n f l a t e ( ) a d d ( ) stack s t a c k s t a c k 3.6 handle classes C + + C
54 52 C handle classes Cheshire Cat [ 1 ] s m i l e struct cheshire; cheshire [1] John Carolan Lewis Carroll C + +
55 3 53 cheshire struct handle::cheshire { [ 1 h a n d l e :: i n i t i a l i z e () cheshire struct ] h a n d l e :: c l e a n u p () H A N D L E. C P P c h e s h i r e H A N D L E. C P P h a n d l e [1] 12 n e w
56 54 C C ) p u b l i c private p r o t e c t e d 2) f r i e n d 3) H A N D L E. C P P c h e s h i r e U S E H A N D L. C P P
57 4 2 C s t r u c t C C + + C + + C C + + C s t r u c t s t r u c t C s t r u c t C + + C s t a s h s t a c k i n i t i a l i z e () C + + S t r o u s t r u p 3
58 56 C + + a a X :: X () t r e e tree t(12); // 12 t r e e ( i n t ) i n i t i a l i z e () C + + v o i d 4.2 C?? C + + ~ class Y { p u b l i c : } ; ~ Y ( ) ;
59 4 57 g o t o C g o t o C + + g o t o C setjmp() l o n g j m p ()
60 58 C C P a s c a l C + + C C + + C C C + + C + +
61 4 59 b u f x y g C for C + + f o r f o r C + + i j f o r C f o r i j i _ l o o p _ c o u n t e r i C + + f o r
62 60 C C s w i t c h g o t o g o t o s w i t c h 12
63 stash c l e a n u p () s t a s h i n i t i a l i z e ( ) i n i t i a l i z e () c l e a n u p ()
64 62 C + + s t a s h
65 4 63 c l e a n u p () i n t S t a s h s t r i n g S t a s h 4.5 stack s t a c k s t a c k l i n
66 64 C + + l i n k s t a c k : : p u s h [ 1 ] C + + [1]
67 4 65 n e w 12 C s t a c k t e x t l i n e s 4.6 s t r u c t c l a s s C + + int a[5]={1,2,3,4,5};
68 66 C + + int b[6]={0}; 0 f o r 1 f o r int c[] = {1,2,3,4}; sizeof c/sizeof *c( ) for(int i = 0; i< sizeof c / sizeof *c; i++) c [ i ] + + ; s t r u c t C s t r u c struct X { } ; int i; float f; char c; X x1 = {1,2.2,'c' }; s t r u c t X x2[3] = {{1,1.1, 'a'},{2,2.2, 'b'}}; s t r u c t s t r u c t struct Y { } ; float f; int i; Y(int A); // presumably assigned to i Y y2[] = {Y(1),Y(2),Y(3)}; s t r u c t c l a s s,
69 v a n i l l a, Y Y y4[2] = {Y(1)} Y Y y5[7] Y y; struct c l a s s class Z { int i; // private }; // no constructor Z z,z2[10]; C C + + C + + C C + + C s t r u c t
70 68 C + + C + + C C + + C C + + C + + C C + + C + C 4.8 C + + S t r o u s t r u p C + + C C ) 3 HANDLE.H,HANDLE.CPP USEHANDL.CPP 2) 3) 4)
71 5 p r i n t _ i n t () p r i n t _ c h a r ( ) p r i n t _ f l o a t ( ), C + + C + + f ( h e l l o ), f ( h i, 1 ) f ( h o w d y, 2, c ) 5.1 2
72 70 C + + void f(); class x {void f();}; x f f x :: f () 2 _ f _ x _ f void print(char); void print(float); _ p r i n t _ p r i n t _ c h a r _ p r i n t _ f l o a t void f(); int f(); int x = f(); C C C C + +
73 5 71 //: DEF.CPP -- Function definition void f(int) {} //: USE.CPP -- Function misdeclaration void f(char); main() { //! f(1); //Causes a linker error } f ( i n t ), ( ) f ( c h a r ) C C + + f _ i n t f _ c h a r f _ c h a r f _ i n t C + + C 5.2 s t a s h s t a s h () Q u a n t i t y q u a n t i t y s t o r a g e
74 72 C + +
75 5 73 s t o r a g e, a d d () a d d ()
76 74 C + + s t a s h 5.3 s t a s h C + + s t a s h stash(int Size);// zero quantity stash(int Size,int Quantity); stash(int Size, int Quantity=0); s t a s h ( i n t ) s t a s h ( i n t, i n t stash A(100),B(100,0); A void fn(int x /* =0*/ ) { //... void f(int X, int = 0, float =1.1); C + + void f(int X, int,float f) {/*...*/} x f, p l a c e h o l d e r, f ( 1 ) f ( 1, 2, 3. 0 )
77 5 75 o n o ff
78 76 C + + b i t s () B i t Ve c t o r B i t Ve c t o r b i t s () b i t s ( i n t )
79 B i t Vector b(0) 8 B i t Vector char* 0 B i t Ve c t o r B i t Vector b((unsigned char * )0) B i t Vector b b. b i t s ( 64 ), 8 c h a r * unsigned char* B i t Vector(unsigned char*,int) B i t Ve c t o r ( c h a r *) p r i n t () c h a r * B i t Ve c t o r s e t () c l e a r () r e a d (), p r i n t () B i t Ve c t o r 0 1 B i t Ve c t o r 8 B i t Ve c t o r p r i n t ( )
80 78 C + +
81 5 79 f o r f o i n i t [ i n d e x ]&( 0 x 80 > > o ff s e t ) 16 0 x 80 1 o ff s e t 1 s e t () B i t Vector p r i n t () 0 1 B i t Ve c t o r
82 80 C n u m B y t e s 8 0 s e t () c l e a r () r e a d () a s s e r t ( S e t () r e a d () 1 s e t () 1 r e a d () c l e a r ( 1 ~ s e t () r e a d () c l e a r () c l e a r () bytes[bit/char_bit]&=~(1<<(bit % CHAR_BIT)) b i t s () r e a l l o c () b y t e s r e a l l o c () p r i n t () m s g C p u t s () r e a d () 8 B i t Ve c t o r p r i n t () B i t Ve c t o r B i t Ve c t o
83 5 81 b v 1 b v 2 b v 3 B i t Ve c t o r s e t () c l e a r () r e a d () p r i n t () b v 2 B i t Ve c t o r C + + b i t s b i t s t r i n g 5.4 B i t Ve c t o r b i t s () int bits(int sz=-1); - 1 b i t s - 1 int i=bv1.set(10); - 1
84 82 C ) m e s s a g e c h a r * c h a r * p r i n t (); c h a r * 2) 3) S TA S H 4. H S TA S H 4. C P P s t a s h 4) f l a g s B i t Ve c t o r s e t () c l e a r () r e a d () i n d e x o ff s e t m a s k 5) F L A G S. C P P 100
85 6 C I / O I / O I / O C C + + C I/O 6.1 C C C c l o s e () C I / O r I / O fp( )
86 84 C + + fopen( ) exit( ) fp( ) f I / O fp( ) fp( ) f p () f f f p () I / O C C + +
87 6 85 p r i n t f ( ) S T D I O. H I / O v f p r i n t f () F i l e F i l F i l e F i l e f 0 f
88 86 C F F F i l e [ 1 ] I / O / 1) p r i n t f ( " % c ", ' x ' ) ; 2) p r i n t f () 3) p r i n t f () C + + I / O 4) C + + p r i n t f () C p r i n t f () s c a n f () p r i n t f () C C + + I / O h e l l o, w o r l d, I / O C + + I / O I / O C C + + < < > > 5 [1] FULLWRAP test file
89 6 87 C + + C C + + 1) C C + + C + + C C + + C 2) C + + C ++ C C C < < < < 1 ; < < > > i s t r e a m o s t r e a m ( i f s t r e a m s ) ( o f s t r e a m s ) c h a r * i s t r s t r e a m s ( o s t r s t r e a m s ) C + + s t r i n g i s t r i n g s t r e a m s ( o s t r i n g s t r e a m s ) I / O c i n c i C s t d i n I O S T R E A M. H
90 88 C + + > > > < < c o u t ( c e r r ) p r i n t f () 1. e n d l c o u t < < f l u s h o c t ( ) d e c ( ) h e x ( ) c o u t < < h e x < < " 0 x " < < i < < e n d l c i n > > w s e n d s e n d l s t r s t r e a m s I O S T R E A M. H I O M A N I P. H c i n > > c o u t < < s c a n f ()
91 6 89 b u f t h i s b u f b u c i n
92 90 C + + G U I I / O c i n 1) G U I 2) 3) c o u t c o u c o u t g e t g e t l i n e \ n g e t g e t g e t g e t l i n e g e t l i n e 1. get g e t i n r e a d w r i t e 3. g e t g e g e t l i n e g e t E O F g o o d e o f f a i l b a d e o f b i t f a i l b i t b a d b i t r e a d
93 6 91 w h i l e ( c i n ) i f ( c i n ) i f c i n e o f b i t f a i l b i t [ 1 c l e a r () ] 6.3 C S T D I O. H c l o s e o f s t r e a m F S T R E A M. I / O I O S T R E A M. H [1]
94 92 C + + i f s t r e a m o f s t r e a m a s s e r t () (, 11 ) w h i l e g e t () S Z - 1 \ n g e t g e t g e i n. g e t () g e t i n i g n o r e 1 i g n o r e () E O F c o u t o u t o s t r e a m g e t l i n e o u t c l o s e o p e n i n 12 w h i l e g e t l i n e \ n g e t l i n e () g e t () i o s :: i n i o s :: o u t i o s :: a p p i o s :: a t e i o s :: n o c r e a t e i o s :: n o r e p l a c e i o s :: t r u n c i o s :: b i n a r y i f s t r e a m i o s :: a p p i o s :: a t e i o s :: i n o f s t r e a m i o s :: t r u n c
95 6 93 O R 6.4 I / O s t r e a m b u f s t r e a m b u f I / O s t r e a m b u f s t r e a m b u f s t r e a m b u f s t r e a m b u f s t r e a m b u f s t r e a m b u f r d b u f () s t r e a m b u f s t r e a m b u f s t r e a m b u f < < < < i f s t r e a m a s s e r t ( i n ) c o u t < < i n. r d b u f ( ) c o u t streambuf get() g e t s t r e a m b u f s t r e a m b u
96 94 C g e t r d b u f () g e t i g n o r e g e t () 6.5, s t r e a m p o s C f s e e k () s t r e a m p o s t e l l t e l l p t e l l g p g s t r e a m p o s s e e k p s e e k g s t r e a m p o s s e e k p s e e k g I o s : : b e g I o s : : c u r I o s : : e n d C C + + S T D I O. H C + + ( c i n c o u t )
97 6 95 i f s t r e a m a s s e r t s e e k g s t r e a m p o s l o n g t y p e d e f t e l l g 1 / 10 s t r e a m p o s s p 2 s e e k g r d b u f s t r e a m b u f s e e k g streampos sp2 / s t r e a m b u f i f s t r e a m i f s t r e a m o s t r e a
98 96 C + + i o f i l e. o u t c o u t < < i n 2. r d b u f () Where does this end up? s e e k p s e e k g o u t strstreams s t r s t r e a m s t r s t r e a i s t r s t r e a m s t r s t r e a m o s t r s t r e a s t r s t r e a m s i s t r s t r e a m s b u f [ s i z e ] i s t r s t r e a m [ 1 ] [1] D O S
99 6 97 C a t o f () a t o i () istrstream s(" This is a test") s > > i > > f i f This is a test i 1 f b u f 2 r d b u f s t r s t r e a m s o s t r s t r e a m : : o s t r s t r e a m ( c h a r *, i n t, i n t = i o s : : o u t ) i o s :: a t e i o s :: a p p o s t r s t r e a m s e n d s o s t r s t r e a m
100 98 C + + i n t f l o a t r d b u f ( c o n t r o l - Z ( u n i x c o n t r o l - D ) g e t l i n e b u f b u f ostrstream os i o s :: a p p b u f o s t r s t r e a m e n d s e n d l b u f c o u t < < b u f o s. r d b u f () s t r e a m b u f c o u t < < o s. r d b u f () s t r s t r e a m s i s t r s t r e a m s o s t r s t r e a m ostrstream A A s t r s t r e a m s t r e a m b u f A s t r char* cp=a.str() A A A o s t r s t r e a m s t r c h a r *
101 6 99 s t r o s t r s t r e a m o s t r s t r e a m o s t r s t r e a s t r () c h a r * C + + n e w d e l e t e 12 C m a l l o c () f r e e () n e w d e l e t e C + + n e w o s t r s t r e a m n e w d e l e t e ostrstream A s t r () c h a r * delete A.str() o s t r s t r e a m f r e e z e () f r e e z e () o s t r s t r e a m s t r e a m b u f f r e e z e A. r d b u f ( ) - > f r e e z e ( 0 ) A A s t r s e n d s s t r () c h a r * s s e n d s s e e k p r d b u f () f r e e z e ( 0 ) s t r e a m b u f s
102 100 C + + s s t r ( ) o s t r s t r e a m o s t r s t r e a m c h a r * o s t r s t r e a m r d b u f () o s t r s t r e a m 1. s t r () o s t r s t r e a m s t r s s t r c h a r * c h a r * d e l e t e s t r () c h a r * v o i d * c h a r * < < v o i d * < < s t r () s 0 o s t r s t r e a m 2. C++ string s t r i n g s t r e a m [ 1 c h a r * s t r s t r e a m ] 6.7 p r i n t f () [1]
103 i o s I O S T R E A M. H i o s :: f l a g s () long(typedefed to fmtflags) s e t f ( ) o n o ff o n / o ff s e t f ( f m t f l a g s ) o n u n s e t f ( f m t f l a g s ) o ff o n / o ff i o s : : s k i p w s i o s : : s h o w b a s e i o s : : s h o w p o i n t i o s : : u p p e r c a s e i o s : : s h o w p o s i o s : : u n i t b u f i o s : : s t d i o C + + A - F E + C I / O c o u t c o u t. s e t f ( i o s :: s h o w p o s ) c o u t. u n s e t f ( i o s : : s h o w p o s ) C I / O C i o s :: s t d i o p r i n t f () 1. s e t f i o s :: b a s e f i e l d i o s d e c s e t f i o s :: h e x i o s :: h e x i o s :: d e c s e t f () s e t f ( i o s :: h e x, i o s :: b a s e f i e l d ) i o s :: b a s e f i e l d i o s :: h e x s e t f () h e x ()
104 102 C + + s e t ( ) i s o : : b a s e f i e l d i o s : : d e c i o s : : h e x i o s : : o c t i o s :: f l o a t f i e l d i o s :: s c i e n t i f i c i o s :: f i x e d a u t o m a t i c (Neither bit is set) i o s : : a d j u s t f i e l d i o s : : l e f t i o s : : r i g h t i o s : : i n t e r n a l 2. f u n c t i o n int ios::width() int ios::width(int n) int ios::fill() int ios::fill(int n) int ios::precision() int ios::precision(int n) 0 6 i o s :: floatfield w i d t h () 6.7.2
105 6 103
106 104 C + + D a s t r i n g i z i n g a D a a T
107 6 105
108 106 C C + + I O S T R E A M. H d e c o c t h e x s e t f ( i o s :: d e c, i o s :: b a s e f i e l d ) s e t f ( i o s :: o c t, i o s :: b a s e f i e l d ) s e t f ( i o s :: h e x, i o s :: b a s e f i e l d ) IOSTREAM.H [ 1 ] w s e n d l e n d s f l u s h s h o w b a s e n o s h o w b a s e s h o w p o s n o s h o w p o s u p p e r c a s e n o u p p e r c a s e s h o w p o i n t n o s h o w p o i n t s k i p w s n o s h i p w s l e f t r i g h t i n t e r n a l s c i e n t i f i c f i x e d C A - F E s e t p r e c i s i o n ( ) i o s : : p r e c i s i o n ( ) I O M A N I P. H setiosflags(fmtflags n) resetiosflags(fmtflags n) setbase(base n) setfill(char n) setprecision(int n) setw(int n) n i o s :: s e t f () n i o s :: u n s e t f () n n n 0 10 C x f 1 5 d e c o c t h e x n i o s f i l l n i o s p r e c i s i o n n i o s w i d t h [1]
109 6 107
110 108 C + + s e t i o s f l a g s ( ) r e s e t i o s f l a g s ( ) O R s e t f () u n s e t f () 6.9 e n d l o s t r e a m 10 e n d l ostream& endl(ostream&) cout<<"howdy" <<endl e n d l I O S T R E A M. H o s t r e a m n l
111 6 109 o s < < ' \ n ' [ 1 o s n l ] n l e n d l Jerry Schwarz [2] < < < < 11 [1] n 1 8 [2]
112 110 C + + f i x w c h a r * < < f i x w o s t r e a m o s t r e a m f i x w cout <<fixw(string,i)<<endl f i x w < < bin U L O N G _ M A X unsigned long L I M I T S. H c h a r * f i x w unsign long b i n f i x w b i 9
113 u n i x s e d a w k s e d a w k m a i n i o s :: n o r e p l a c e i s t r s t r e a m C t o u p p e r () i n t c h a r 1.
114 112 C + + N A M E. H N A M E. C P P
115 6 113
116 114 C + +
117 6 115 o s t r s t r e a m enum bufs o s t r s t r e a m c h a r b c h a r b u f n u m b u f n u m b u f s e n u m b u f n u m b u f b S Z b a s e h e a d e r i m p l e m e n t C P P H l i n e 1 guard1 g u a r d 2 g u a r d 3 C P P l i n e l C P P i n c l u d e C P P o s a r r a y o s t r s t r e a m o s t r s t r e a m b u f s b o s a r r a y b o s t r s t r e a m C P P i f s t r e a m s s t r s t r e a m // C s t r s t r () o s t r s t r e a m s t r s t r () s t r s t r e a m o s t r s t r e a o f s t r e a m o s t r s t r e a m 2. //
118 116 C + +
119 6 117 m a k e r m a k e r strstream edited e d i t e d
120 118 C + + p r i n t f ( ) d a t a p o i n t o s t r e a m p r i n t f ()
121 6 119 p r i n t f () s e t f () p r e c i s i o n ( 4 s e t w () 2 s e t w () 10 0 * ` ` ` 1. w r i t e (),
122 120 C + + d a t a p o i n t : : p r i n t ( ) A S C D ATA. T X T A S C D ATA. B I N i o s :: b i n a r y C t i m e (), t i m e _ t GMT C s c r a n d () t m
123 6 121 t m C l o c a l t i m e () t m t m l o c a l t i m e () l o c a l t i m e () l o c a l t i m e () d a t a p o i n t tm struct l o c a l t i m e () d. Ti m e = * l o c a l t i m e ( & t i m e r ) t i m e r 55 C r a n d () R A N D _ M A X % r a n d () D ATA. B I N R A M w r i t e () unsigned char* d a t a p o i n t d a t a p o i n 2. D ATA 2. T X T D ATA. T X T
124 122 C + + ifstream bindata D ATA. B I N
125 6 123 i o s : : n o c r e a t e a s s e r t () r e a d ( datapoint d d a t a p o i n t r e a d () b i n d a t a f a i l b i t w h i l e c l e a r () f a i l b i t r e c n u m 4 s e t w () r e a d () e l s e f a i l b i t c l e a r () r e a d () f l a t - f i l e D B M S A p p l e B A S I C D B M S C ) in i f s t r e a m o s o s t r s t r e a r d b u f () o s t r s t r e a m s t r () o s c h a r * C toupper() o s 2) 3) 1 4) g r e p
126
127 7 c o n s t C + + C c o n s t v o l a t i l e, c o n s t c o n s t # d e f i n e s 7.1 C C + + c o n s t C #define BUFSIZE 100 B U F S I Z E B U F S I Z E C + + c o n s t const bufsize=100 const int bufsize=100 b u f s i z e char buf[bufsize] c h a r i n t f l o a t d o u b l e c o n s t c o n s # d e f i n e const # d e f i n e c o n s t c o n s t
128 7 125 c o n s t C + + c o n s c o n s t c o n s t c o n s t e x t e r n extern const bufsize e x t e r n c o n s t C + + c o n s t c o n s t c o n s t c o n s t c o n s t c p p c o n s t const c o n s t # d e f i n e s c o n s t i j i j j j j b u f j m a i n () c c o n s t C c 2 c # d e f i n e
129 126 C + + c o n s t c o n s t c o n s t C C + + C C c o n s t C C c o n s t C const bufsize=100 char buf[bufsize] b u f s i z e C const bufsize C + + C C c o n s t C + + c o n s t C + + C e x t e r n extern const bufsize;//declaration only C C c o n s t c o n s t C # d e f i n e
130 c o n s t c o n s t c o n s t c o n s t c o n s const c o n s t const int* x x const int x c o n s t x c o n s t int const* x x i n t c o n s t x c o n s t i n t c o n s t i n t const c o n s t c o n s t * int d=1 int* const x=&d x i n t c o n s t c o n s t * x = 2 c o n s t c o n s int d=1 const int* const x=&d // (1) int const* const x2=&d // (2) c o n s t * int* u=&w
131 128 C + + i n t * * int* u=&w v = 0 int* u int v C + + c o n s t c o n s t c o n s t c o n s t c o n s c o n s t c o n s t C + + c o n s t c o n s t char* cp="howdy" h o w d y 7.3 c o n s t c o n s t c o n s t const c o n s t
132 7 129 x ( ) c o n s t c o n s t c o n s 10 & c o n s t const const int g() c o n s t c o n s t
133 130 C + + f 5 ( ) const X f 6 () const X c o n s t c o n s t c o n s t f 7 () c o n s t C c o n s t
134 c o n s t c o n s t c o n s t c o n s t c o n s t t () c o n s t u () c o n s t
135 132 C + + u () c o n s t c o n s t c o n s t c o n s v () w () v () const char* v () w () v ( w () m a i n () t ( c o n s t c o n s t t () u () c o n s t c o n s t c o n s t v () c o n s t w () c o n s t const int* const int* const int*const c o n s t C C + + C + + c o n s t c o n s t C c o n s t
136 7 133 f () X f () g 1 () g 2 () g 1 g 1 () c o n s t g 2 () 7.4 c o n s t c o n s t c o n s t c o n s t c o n s t const enum c o n s t # d e f i n e s i z e s i z e # d e f i n e # d e f i n c o n s t c o n s t C c o n s t c o n s t c o n s t c o n s t c o n s t c o n s t 1. c o n s t c o n s
137 134 C c o n s t float pi ( ) i n t e g e r i n t e g e r integer I[100] f o r m e m s e t () c o n s t c o n s t C c o n s t c o n s t e n u m
138 7 135 e n u m enum { one=1,two=2,three} e n u m t h r e e 3 e n u m
139 136 C + + p u s h () const char* p o p () const char* s t a c k const char* s t r i n g s t a c k i c e C r e a m S t r i n g s t a c k e n u m C + + static const 9 C C + + C + + C a c o l o r C a + + C + + C + + c o l o r i n t 1 i n t c o l o r C + + c o l o r i n t b l u e 1 c o l o r 1 e n u m e n u const c o n s t c o n s t c o n s t const int i=1 const blob B(2)
140 7 137 B b l o b c o n s t 2 c o n s t c o n s t c o n s t c o n s c o n s t c o n s t c o n s t c o n s t c o n s t c o n s t c o n s t c o n s t c o n s t c o n s t c o n s c o n s t int X::f() const {return i } f () i c o n s t c o n s t c o n s c o n s t c o n s t
141 138 C + + c o n s t q u o t e () c o n s t l a s t q u o t e L a s t q u o t e () c o n s t c o n s c q c o n s t c o n s t c o n s t c o n s t c o n s t c o n s t c o n s t c o n s t c o n s t t h i s t h i s c o n s t
142 7 139 t h i s c o n s t m u t a b l e c o n s t c o n s t c o n s t R O M
143 140 C + + c o n s t c o n s t c o n s m u t a b l e c o n s t c o n s t 1) class s t r u c t 2), c o n s t R O M R O 7.5 volatile v o l a t i l e c o n s t v o l a t i l e v o l a t i l e v o l a t i l e c o n s t v o l a t i l e const volatile
144 7 141 c o n s t v o l a t i l e v o l a t i l e v o l a t i l e i s r () t h i s I S R i s r ( ) v o l a t i l e c o n s t c - v 7.6 c o n s t const correctness c o n s t c o n s t C c o n s t f l y () b i r d f l y () r o c k r o c k v o i d * v o i d * b i r d f l y () C v o i d * C 2. c o n s t c o n s 3. c o n s t c o n s t c o n s c o n s t C C + + c o n s t c o n s C C + +
145
146 8 C + + C C + + C C ( m a c r o ) C A L L R E T U R N C + + C C + + ( p r i v a t e ) C + + (inline function) C + + C #define f (x) (x+1) f f (1) (x) (x+1) (1) f f ( 1 ) (1 + 1) #define floor(x,b) x>=b?0:1
147 8 143 if(floor(a&0x0f,0x07)) //... if(a&0x0f>=0x07?0:1) & > = #define floor(x,b) ((x)>=(b)?0:1) > = + / - - #define band(x) (((x)>5 && (x)<10)? (x) : 0)
148 144 C + + a 4 a 5 S T D I O. H putc( ) C toupper( toupper(*p++ ) [1] C C + + class X { int i; p u b l i c : #define val (X::i) //Error p u b l i c 8.2 C + + C + + [1] Andraw Koenig C A d d i s i o n - We s l e y, 1989
149 8 145 i n l i n e inline int PlusOne(int x); inline int PlusOne(int x) { return ++x ;} + C A L L static, i n l i n e
150 146 C ( p r i v a t e ) ( p r i v a t e ) read( ) read( t h i s C A L L i ( p u b l i c ), i i i i n t f l o a t int int i ( a c c e s s o r s ) ( m u t a t o r s )
151 Wi d t h H e i g h t C Ti m e
152 148 C + +
153 8 149 C Ti m e time_t T tm local A S C I I A s c i i t i m e _ t updatelocal( ) updateascii( ) mark( ) A S C I I ascii( ) updateascii( ) ascii( ) updateascaii( C DaylightSaving( ) updatelocal( ) updatelocal( ) Ti m e 2 Ti m
154 150 C ( t h i s ) 8.3.2
155 8 151 g( ) f( g( ) g( ) f( ) f( ) g( ) 8.3.3
156 152 C + + w i t h M e m b e r s Q P S 8.4 Dan Saks in situ ( ) i n l i n e R E C TA N G L. C P P
157 8 153 i n l i n e In situ in situ 8.5 C C # #define DEBUG(X) cout<<#x " = " << X << endl #define TRACE(S) cout << #S << endl; S # S 2 S f o r for (int i = 0 ; i < 100 ; i++ ) TRACE(f(i)) ; TRACE( ) f o r FIELD( )
158 154 C assert( ) 17 _ F I L E _ _ L I N E _ assert( ) assert( ) assert( ) assert( ) #define NDEBUG A l l e g e a s s e r t allege_error( ) f a l s e
159 8 155 fprintf( ) i o s t r e a m s e x i t ( 1 ) allege( ) i f - t h e n - e l s e e x p r allege_error( ) assert( ) assert( ) assert( ) allegefile( ) allegemen( ) allege( ) A L L E G E. H //#define NDEBUG // turn off asserts allege( ) assert( ) assert( ) Print( ) 2. 3 N E S T F R N D. C P P
160 156 C + + in situ initialize( ) 3. 6 N L. C P P n l 4. A B, A B B B 5. 4 Ti m e
161 9 C + + s t a t i c C C + + s t a t i c s t a t i c C + + C 9.1 C C C + + s t a t i c 1) 2) C + + s t a t i c s t a t i c C C C + + s t a t i c
162 158 C + + static char* s o n e c h a r ( ) o n e c h a r () s o n e c h a r () 0 s t r i n g s o n e c h a r () s s static char* s=0 o n e c h a r () s i f (! s ) s 1.
163 9 159 f () X 2. main() C e x i t () m a i n ( e x i t () e x i t ( C a b o r t () C a t e x i t () m a i n ( e x i t () m a i n () e x i t () a t e x i t () m a i n ()
164 160 C + + o b j c A o b j m a i n () f o b j B g () C m a i n () f () A m a i n () B f () m a i n () g () B C g () f () o f s t r e a m o u t e x t e r n o u t C + + m a i n () m a i n () m a i n ( C s t a t i c. C P P inline function C + + C /
165 9 161 s t a t i c int a=0; a m a i n () a s t a t i c e x t e r n extern int a=0; : static int a=0; a a s t a t i c e x t e r n s t a t i c e x t e r n s t a t i c e x t e r n extern void f() void f() static void f() f () s t a t i c e x t e r n a u t o, a u t o r e g i s t e r r e g i s t e r r e g i s t e r 9.2 s t a t i c t y p e d e f C + + c l a s s, s t r u c t, e n u m u n i o n,
166 162 C + + n a m e s p a c e n a m e s p a c e c l a s s s t r u c t u n i o n e n u m 1) namespace 2) n a m e s p a c e 3) n a m e s p a c e 4) n a m e s p a c e 5) 1. n a m e s p a c e
167 friend s t a t i c y o u () m e u s i n g 1.
168 164 C using using u s i n g n a m e s p a c e using using m a t h u s i n g using u s i n g u s i n g using
169 9 165 u s i n g u s i n g u s i n g 3. using u s i n g u s i n u s i n g u s i n g u s i n g u s i n g u s i n u s i n g
170 166 C + + u s i n g using u s i n g 9.3 C++ C p u b l i c p r i v a t e p r o t e c t e d int A::i=1;
171 9 167 int i=1; i A :: i = w i t h S t a t i c :: w i t h S t a t i c 1.
172 168 C enum hack e n u m 9.3.2
173 t h i s t h i s t h i s s t a t i c
174 170 C + + t h i s t h i s m a i n () e g g e g g
175 9 171 E 9.4 out o o f o u t o u t m a i n () ARM [1] [1] The Annotated C++ Reference Manual,Bjarne Stroustrup M a rgaret Ellis 1990 p p
176 172 C + + fstream out y x 1 y 2 x, y 1 x 2 1) 2) 3) Jerry Schwarz i o s t r e a m c i n, c o u t c e r r
177 9 173 x y initializer init s t a t i c x y i n i t _ c o u n t i n i t D E P E N D. H i n i t _ c o u n t ~ i n i t i a l i z e r ()
178 174 C + + i n i t i a l i z e r i n i t i a l i z e r () C + + n e w d e l e t e C + + C float f(int a,char b); C + + _ f _ i n t _ i n t C _ f C + + f C + + e x t e r n e x t e r n extern "C" float f(int a,char b); f () C C + + C + + C C + C + + C C s t a t i c C + + s t a t i c
179 9 175 const int static int i n l i n e i n l i n p r i n t () 2. STAT D E S T. C P P m a i n () f () g () 3. S TAT D E S T. C P P o u t e x t e r n A o b j o u t 4. e x i t () 5. 7 V O L AT I L E. C P P c o m m :: i s r ()
180
181 1 0 C + + P a s c a l C + + A l g o l C C C + + C + + ( c o p y - c o n s t r u c t o r ) ( & ) C + + ( p o i n t e r- t o - m e m b e r ) 10.1 C++ C C + + C + + v o i d * C v o i d * bird* b; rock* r; void* v; v = r; b = v; C C C++ (&) int x; int & r = x; int & q = 12; 12 int x=0; int & a = x; a + + ; a x
182 ) 2) ) N U L L f( ) g ( ) 1. R E F R N C E. C P P g ( )
183 178 C + + f ( 1 ) i n t 1 2. C void f (int**); int I = 47; int* ip = &I; f (&ip); C
184 C + + X ( X &) X X C int f (int x, char c); int g = f (a,b); c h a r i n t f l o a t d o u b l e f ( ) push b push a call f ( ) add sp,4 mov g, register a b a _ b _ a g f( ) n a m e - m a n g l i n g a C P U C C + + add sp,4 f( ) 1.
185 180 C + + h e l p e r m a i n () b i g f u n ( B B h e l p e r PA S S T R U C. C P P B 2 2. C A L L C P U R E T U R N C A L L (function frame) 3. C C + + I S R I S
186 I S R v o i d C P U I S R R E T U R N R E T U R N I S R C C + + C + PA S S T R U C. C C P main( ) bigfun( ) B 2 bigfun( ) 4. b i t c o p y C C ( s t a t i c )
187 182 C + + h o w m a n y i n t print( ) h 1 f( ) 2 h 2 0 f( ) h C C++ howmany f( ) o b j e c t _ c o u n t o b j e c t _ c o u n t 0 h 2 h h 2 o b j e c t _ c o u n t
188 howmany h2 = f(h); h 2 f( ) b i t c o p y h o w m a n y ( b i t c o p y ) X ( X &) X ( b i t c o p y ) HO W M A N Y. C P P
189 184 C + + i d C strncpy( ) i d strncpy( ) h o w m a n y 2 ( h o w m a n y 2 &) i d i d c o p y C strncat( ) i d print( ) print( i d s t a t i c main( ) f( ) C
190 i o s t r e a m s s t r s t r e a m i f s t r e a m ofstream, ofstream getline( ) s t r s t r e a m 2 2 L I N E N U M. C P P H O W M A N Y 2. O U T
191 186 C + + h 1 f( ) f( h h 2 8 f( ) h h 2 h f( ) 9 h 2 h f( ) 3 h 13 f( ) 2 h h2 h 2 h 15 f ( h ) t h i s f( )
192 h 2 h 0 C b i t c o p y C + + c o m p o s i t i o n
193 188 C + + w i t h C C c o m p o s i t e w i t h C C w i t h C C w i t h C C w o C C print( ) c o m p o s i t e 7 13 c o m p o s i t e w i t h C C w o C C W O C C c o m p o s i t e main( ) composite c2 = c ; c o m p o s i t e 13 w i t h C C w o C C b i t c o p y c o m p o s i t e m a i n composite::print( ) c 2. W O C C c. W O C C memberwise initialization
194 p r i v a t e f r i e n d nocc(const nocc&) c o n s t 2. i o s t r e a m s get( ) c h a r & get( ) char c; c i n. g e t ( c ) ; c o n s t c o n s t
195 190 C C + + ( p o i n t e r- t o - m e m b e r ) C + + struct simple { int a ; }; s p s o sp->a ; so.a ; i n t e g e r i p i p * *ip = 4 ; * * s i m p l e sp->*pm = 47 ; so.*pm = 47 ; - > *. p m * int simple::*pm ; int simple::*pm = &simple::a ; s i m p l e : : a & s i m p l e :: a p o i n t e r- t o - m e m b e r int (*fp)(float) ; (* f p ) i n t * struct simple2 { int f(float); } ;
196 int (simple2::*fp) (float) ; int (simple2::*fp) (float) = &simple2::f ; & fp = simple2::f ; ( p u b l i c ) t y p e d e f [ 1 ] [1] Owen Mortensen
197 192 C + + main( ) Count( ) fptr[1] = &g ; g (this->*fptr[i]) (j); t h i s 10.5 C + + C C + + c a s t C + + A l g o l P a s c a l ( r e f e r e n c e )
198 ( p r i v a t e ) c h a r & main( ) c h a r 2. c o u t 3., PA S S T R U C. C P P
199
200 11 C + + o p e r a t o r 11.1 C C 1 << 4; << 2; 11.2 o p e r a t 1) 2)
201 K += I + J ; + + = r v 11.3 C C ** i n t e g e r b y t e
202 196 C + +
203 11 197
204 198 C + +
205 a o p e r a t o r + + ( a ); a + + o p e r a t o r + + ( a, i n t ) U N A RY. C P P + + b B::perator++( ) b + + B :: o p e r a t o r + + ( i n t ) i n t U N A RY. C P P
206 200 C + +
207 11 201
208 202 C + +
209 11 203
210 204 C + +
211 11 205
212 206 C + +
213 11 207
214 208 C + +
215 = ( s e l f - a s s i g n m e n t ) + = A + = A =
216 210 C + + = U N A RY. C P P B I N A RY. C P P 1) c o n s t + - c o n s t c o n s t ( o p e r a t o r- a s s i g n m e n t + = = ( c o n s t a n t ) 2) i n t e g e r :: o p e r a t o r + i n t e g e r c o n s t 3) A = B = C c o n s t n o n c o n s t A = B = C n o n c o n s t A = B. f o o B A foo( ) n o n c o n s t 4) i n t b o o l C + + b o o l i n t t y p e d e f 5) c o n s t * t h i s int b o o l ( i t e r a t o r ) c o n s t n o n c o n s t (++A).foo( ) foo( ) A (A++).foo( ) foo( ) + + c o n s t c o n s t 1. c o n s t c o n s t + f ( A + B ) A + B f( ) c o n s t c o n s t
217 A + B (A+B).g( ) g( ) i n t e g e r c o n s t c o n s t c o n s t 2. + return integer (left.i + right.i) ; t m p t m t m p integer tmp(left.i + right.i) ; return tmp ; [ ],
218 212 C + + ( ) n e w d e l e t e - > * ( s m a r t ) - >, i t e r a t o r
219 11 213
220 214 C + + o b j f( ) g( ) o b j _ c o n t a i n e r add( ) o b j _ c o n t a i n e r o b j _ c o n t a i n e r s p f r i e n d s p ( i t e r a t o r ) 15 main( ) O C o b j S P SP->f( ) ; //Smart pointer calls SP->g( ) ; S P f( ) g( ) o b j * obj* s p :: o p e r a t o r- > >.*. F o t r a n ** C C
221 i o s t r e a m s << > >
222 216 C + + I[4] = -1 ; [ ] os << ia.i[j] ; I O S T R E A M. H ostream& operator<<(ostream&,int) i a. i [ j ] i n t i s t r e a m o s t r e a m Murry [1] = ( ) [] -> += -= /= *= ^= &= = %= >>= <<= 11.5 C + + = = foo B ; foo A = B ; A = B ; 2 A C + + A f o o = [1] Rob Murray, C++ Strategies & Tactics, Addision-We s l e y, 1993, page 47.
223 = A f o o :: o p e r a t o r = f o o :: o p e r a t o r = o p e r a t o r = = = = = = fee fum(fi) ; = B I N A RY. C P P = = int operator=(int,foo) ; // global = not allowed! = =
224 218 C + + = ( s e l f - a s s i g n m e n t ) 1.
225 = = (reference counting) 0 ( c o p y - o n - w r i t e ) 1
226 220 C + +
227 m e m b l o c k b l o c k m e m b l o c k attach( ) m e m b l o c k detach( ) 0 delete this set( ) m e m b l o c k connted::unalias( ) connted::unalias( ) m e m b l o c k :: u n a l i a s ( ) 1 b l o c k 1 C + + n e w d e l e t e C malloc( ) free( ) n e w d e l e t e new d e l e t e malloc( ) free( ) b l o c k b l o c k memblock::attach( ) = = m e m b l o c k detach( ) m e m b l o c k
228 222 C + + = detach( ) m e m b l o c k write( ) unalias( ) main( ) = main( ) C write( ) C A 2. R E F C O U N T. C P P
229 11 223
230 224 C + +
231 m e m b l o c k s t a t i c b l o c k c o u n t b l o c k n u m print( ) c o u n t e d i d c o u n t e d m e m b l o c k b l o c k m e m b l o c c o p y addname( ) i d 3. = t y p e : : o p e r a t o r = ( t y p e ) = (memberwise assignment)
232 226 C + + f o o = b a r :: o p e r a t o r = = p r i v a t e 11.6 C C + + C
233 f( ) o n e f( ) t w o one t w o t w o :: t w o ( o n e ) t w o :: t w o ( o n e ) t w o f( f( ) t w o f( ) explicit [1] t w o t w o f ( t w o ( O n e )) O n e t w o o p e r a t o r [1] e x p l i c i t
234 228 C + +
235 n u m b e r + ( f r i e n d ) - i n t i n t n u m b e r main( ) n u m b e r n u m b e r n u m b e r + i n t n u m b e r :: o p e r a t o r + i n t n u m b e r i n t + n u m b e r n u m b e r :: o p e r a t o r + n u m b e r - n u m b e r 1 - a n u m b e r 1-1 n u m b e r - C strings s t r i n g C
236 230 C + + strcmp( ) S T R I N G. H S T R I N G. H s t r i n g c h a r * c h a r * s t r i n g
237 X operator Y( ) Y X X Y ( f a n - o u t )
238 232 C + + C A B h( ) main( ) make_a( ) make_b( ) F E E F I. C P P f o fee fiddle f o f e e f e e f e e = fee fiddle = FO ; 11.7
239 private char i o s t r e a m < < > > I O S O P. C P P f s t r e a m s s t r s t r e a m s s t d i o s t r e a m s ( c i n c o u t ) * / n u m b e r int( ) 4. U N A RY. C P P B I N A RY. C P P 5. FA N O U T. C P P
240
241 1 2 C A D C malloc( ) free( ) malloc( ) C + + 1) C + + 2) 3) C + + malloc( ) free( ) C + + n e w d e l e t e 12.1 C + + 1) 2) 2 C ) 2) 3)
242 C C malloc( ) calloc( ) realloc( ) free( C malloc( )
243 236 C + + obj* Obj = (obj*)malloc(sizeof(obj)) ; malloc( ) v o i d * C + + void* malloc( ) 0 Obj->initialize( ) ; C C + + C new C + + n e w n e w n e w foo *fp = new foo(1,2) ; m a l l o c ( s i z e o f ( f o o )) 1 2 f o o t h i s f p f o o n e w n e w n e w foo *fp = new foo ;, delete n e w d e l e t e d e l e t e free( ) n e w d e l e t e delete fp ; f o o d e l e t e n e w malloc( ) calloc( ) realloc( ) d e l e t e n e w d e l e t
244 malloc( ) free( ) t r e e < < o s t r e a m f r i e n d o s t r e a m & o s t r e a m calloc( ) realloc( ) malloc( ) 1) malloc( ) 2) m a l l o c ( ) 3) malloc( ) free( )
245 238 C + + malloc( ) 12.2 n e w d e l e t e s t a s h s t a c k string s t a s h s t a c k s t a s h s t a c d e l e t e v o i d d e l e t e v o i d s t a s h s t a c k d e l e t e S t r i n g S t r i n g
246 p r i v a t e p r i v a t e = S t r i n g S t r i n g f r i e n d makestring( ) s t a t i c make( ) String::make( ) s = new char[strlen(s) +1] ; c h a r c h a r * c h a r S t r i n g i o s t r e a m i o s t r e a m St r i n g stash 5 s t a s h 5 p s t a s h 5 s t a s s t a s h n e w d e l e t e pointer stash
247 240 C + + s t o r a g e v o i d n e w malloc( ) v o i d * v o i d storage = new void*[quantity = Quantity] ; v o i d v o i d [] fetch( ) v o i d
248 add( ) inflate( ) realloc( ) n e w r e a l l o c malloc( ) realloc( ) free( ) n e w d e l e t e malloc( ) new( ) delete( ) p s t a s h s t a s h
249 242 C + + intstash.add( new int(i) ) ; s t a s h n e w new int(i) i n t i n t i p s t a s h :: o p e r a t o r [] p s t a s h v o i d 2 p s a t s h S t r i n g makestring( ) String::make( ) ( s t a t i c char* p = *(String*)stringStash[i] ; [] S t r i n g * S t r i n g c h a r * S t r i n g S t r i n g c h a r * stack s t a c k 4
250 struct link stack::push( ) n e w l i n k :: l i n k d a t a n e x t stack::push( ) l i n k l i n k head = new link(data, head) ; 4 d e l e t e free( ) s t a s h v o i d s t a c k
251 244 C + + s t a c k s t a s h S t r i n g s t a c k s t a c k s t a c k 12.3 new delete C n e w foo* fp = new foo[100] ; 100 f o o f o o * foo* fp2 = new foo ; f p f p [ 2 ] delete fp2 ; //O K delete fp ; // Not the desired eff e c t f o o f p 2 f p 99
252 delete []fp ; delete [100]fp ; f p int const* q = new int[10] ; const int* q = new int[10] ; c o n s t int int* const q = new int[10] ; q q n e w n e w - h a n d l e r 0 n e w - h a n d l e r (throw an exception) 17 n e w - h a n d l e r N E W. H set_new_handler( ) n e w - h a n d l e r
253 246 C + + new-handler v o i d w h i l e i n t n e w n e w - h a n d l e r n e w - h a n d l e r 12.5 new delete n e w n e d e l e t e d e l e t n e w d e l e t e n e w d e l e t e C + + n e w d e l e t e n e w d e l e t e C + + n e w d e l e t e n e w n e w n e w d e l e t e n e w n e 0 n e w - h a n d l e r b a d _ a l l o c 17 n e w d e l e t e new delete n e w d e l e t e
254 n e w s i z e _ t 0 0 n e w - h a n d l e r n e w v o i d * d e l e t e n e w v o i d * v o i d * d e l e t e v o i d n e w d e l e t e
255 248 C + + n e w d e l e t e C malloc( ) free( ) n e w d e l e t e printf( ) puts( ) i o s t r e a m s i o s t r e a m c i n c o u t c e r r n e w printf( ) n e w main( ) n e w d e l e t e s n e w d e l e t e new delete n e w d e l e t e s t a t i c s t a t i c n e w n e w n e w n e w d e l e t e n e w d e l e t e f r a m i s f r a m i s ( b y t e s ) ( b y t e )
256 psize f r a m i s f r a m i s p s i z e 0 0 n e w n e w n e w - h a n d l e r n e w d e l e t e i o s t r e a m s d e l e t e f r a m i s f r a m i s n e w n e d e l e t e
257 250 C + + d e l e t e 0 main( ) f r a m i s f r a m i s n e w d e l e t e new delete n e w d e l e t e new( ) delete( ) n e w [] d e l e t e []
258 n e w d e l e t e n e w d e l e t e n e w d e l e t n e w d e l e t e n e w i n t 2 20 n e w * d e l e t e d e l e t e w i d g e t n e w 4 4 delete []widget ; n e w d e l e t e foo* f = new foo ; n e w f o o f o
259 252 C + + n e w 0 0 n e w n e n e w 1) 2) n e w n e w n e w n e w s i z e _ t X* xp = new(a) X ;
260 a n e w n e w n e w n e w d e l e t e xp->x::~x( ) ; //explicit destructor call new 12.6
261 254 C + + C C + + n e w d e l e t e C + + n e w d e l e t e c o u t n e w d e l e t e n e w d e l e t e 2. p s t a s h 1 n e w 3. n e w d e l e t e 4. F R A M I S. C P P n e w d e l e t e n e w d e l e t e
262 1 3 C + + C C X
263 256 C + + p r i v a t e p u b l i c p e r m u t e () X X Y 13.2 Y Y X
264 Y X Y X X m a i n () s i z e o f ( Y s i z e o f ( X ) p u b l i c p r i v a t e p u b l i c p r i v a t e p u b l i c p u b l i c p u b l i c h a n g e () p e r m u t e () p u b l i c s e t () s e t () Y r e a d () p e r m u t e () m a i n ( Y s e t () c h a n g e () s e t ()
265 258 C C + + p r i v a t e C + + b a r f o o bar i n t foo::foo(int i) : bar(i) { // foo2:foo2(int I) : bar(i), memb(i+1) { //... foo2 bar memb C + +
266 int i(100); 13.4
267 260 C + + C B A C::f() B :: f () a. f ( C::f() C f() a. f () B :: f (
268 ofstream
269 262 C + + bart d o h () bart, milhouse operator= 11 operator=
270 operator= operator other() root other derived root f() other main() root derived operator=( ) root other root 13.5
271 264 C + + private p u b l i c Car
272 i s - a has-a ifstream ifstream strstream fname1 ifstream & ifstream fname1 main
273 266 C + + c o u t < < f i l e. r d b u f ( ) < < e n d l ; filebuf * rdbuf() {return File.rdbuf();} fname1 rdbuf() ifsream
274 ofstream fname2 fname2 o f s t r e a m stack stack S T R I N G S. H S TA C K 11.H
275 268 C + + S TA C K 11.OBJ s t r i n g l i s t stack p u s h () s t r i n g s t a c k v o i d p e e k () p o p () s t r i n g v o i d 12 s t a c k :: ~ s t a c k () d e l e t e v o i d d e l e t e v o i d s t r i n g l i s t :: ~ s t r i n g l i s t () s t r i n g d e l e t e 1) stack p r o t e c t e d s t r i n g l i s t p r o t e c t e d 2) s t a c k 3) s t r i n g s t r i n g l i s t public p r i v a t e F N A M E 2. C P P private p r i v a t e p r i v a t e p r i v a t e p r i v a t e p r i v a t e p u b l i c p r i v a t e p u b l i c
276 p r i v a t e p r i v a t e p r o t e c t e d p r i v a t e p r o t e c t e d p r i v a t e p r i v a t e C S S H A P E p r o t e c t e d
277 270 C + + p r i v a t e p u b l i c p r i v a t e p u b l i c p r o t e c t e d i s - a ofstream ofstream FNAME2.CPP ofstream fname2
278 i n s t r u m e n t w i n d i n s t r u m e n t p l a y () wind w i n d instrument t u n e () i n s t r u m e n t m a i n () t u n e () w i n d C + + w i n d i n s t r u m e n t t u n e () instrument w i n d t u n e () i n s t r u m e n t i n s t r u m e n t w i n d i n s t r u m e n t W I N D. C C P 17
279 272 C s t a c k s t r i n g l i s t s t r i n g I N H S TA C K. C P P ( ) s t a c k s t r i n g l i s t s t r i n g l i s t p r i v a t e s t r i n g l i s t
280 W I N D. C P P ( ) w i n d i n s t r u m e n t wind w; instrument * ip = &w; i p i n s t r u m e n t i p w i n d p l a y () i p - > p l a y ( m i d d l e C ) ; i n s t r u m e n t p l a y () i n s t r u m e n t p l a y () w i n d p l a y () C + + v i r t u a l C A R. C P P v e h i c l e v e h i c l e v e h i c l e c a r 2. A B A C C B C C P S TASH.H & PSTA S H. C P P p s t a s h S t r i n g P S T E S T. C P P p s t a s h 4. p r i v a t e p r o t e c t e d
281
282 1 4 C + + w h a t h o w p r i v a t e C + + C C + + C + + C C + + C + + C C + + C C + + C + + O O P 14.1
283 t u n e () i n s t r u m e n t i n s t r u m e n t m a i n () w i n d t u n e () instrument w i n d w i n d i n s t r u m e n t w i n d i n s t r u m e n t w i n d i n s t r u m e n t 14.2 W I N D 2. C P P i n s t r u m e n t :: p l a y
284 276 C + + w i n d i n s t r u m e n t w i n d :: p l a y i n s t r u m e n t p l a y C W I N D 2. C P P b i n d i n g C i n s t r u m e n t 14.3 C + + v i r t u a l v i r t u a l v i r t u a l v i r t u a l v i r t u a v i r t u a l v i r t u a v i r t u a l W I N D 2. C P P p l a y () v i r t u a l
285 w i n d :: p l a y v i r t u a l W I N D 2. C P P play( ) v i r t u a l t u n e () O O P t u n e () i n s t r u m e n t t u n e ()
286 278 C + +
287 w i n d v i r t u a l a d j u s t () b r a s s w o o d w i n d A [] instrument f () t u n e () v i r t u a l C + + C 14.4 C++ C + + v i r t u a l b r a s s i n s t r u m e n t p l a y ()
288 280 C + + V TA B L E V TA B L E v p o i n t e r V P T R V TA B L E V P T R V TA B L E V TA B L E V P T R
289 i n t o n e _ v i r t u a l n o _ v i r t u a l v o i d V P T R one_virtual t w o _ v i r t u a l s V P T R C + + v i r t u a l int a W I N D 4. C P P A [] i n s t r u m e n t instrument w i n d p e r c u s s i o n s t r i n g b r a s s i n s t r u m e n t i n s t r u m e n t 14-1 i n s t r u m e n t v i r t u a l V TA B L E v i r t u a l v i r t u a b r a s s V TA B L E a d j u s t V P T R S I Z E S. C P P V P T R V P T R V TA B L E V P T R V TA B L E C A L L i n s t r u m e n t b r a s s a d j u s t ()
ebook55-13
1 3 C + + C C + + 13.1 X 256 C + + p r i v a t e p u b l i c p e r m u t e () X X Y 13.2 Y Y X 13 257 Y X Y X X m a i n () s i z e o f ( Y s i z e o f ( X ) p u b l i c p r i v a t e p u b l i c p r i
More information新版 明解C++入門編
511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,
More informationFY.DOC
高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主
More information新・解きながら学ぶC言語
330!... 67!=... 42 "... 215 " "... 6, 77, 222 #define... 114, 194 #include... 145 %... 21 %... 21 %%... 21 %f... 26 %ld... 162 %lf... 26 %lu... 162 %o... 180 %p... 248 %s... 223, 224 %u... 162 %x... 180
More information新・明解C言語入門編『索引』
!... 75!=... 48 "... 234 " "... 9, 84, 240 #define... 118, 213 #include... 148 %... 23 %... 23, 24 %%... 23 %d... 4 %f... 29 %ld... 177 %lf... 31 %lu... 177 %o... 196 %p... 262 %s... 242, 244 %u... 177
More information新版 明解C言語入門編
328, 4, 110, 189, 103, 11... 318. 274 6 ; 10 ; 5? 48 & & 228! 61!= 42 ^= 66 _ 82 /= 66 /* 3 / 19 ~ 164 OR 53 OR 164 = 66 ( ) 115 ( ) 31 ^ OR 164 [] 89, 241 [] 324 + + 4, 19, 241 + + 22 ++ 67 ++ 73 += 66
More information02
Thinking in C++: Volume One: Introduction to Standard C++, Second Edition & Volume Two: Practical Programming C++ C C++ C++ 3 3 C C class C++ C++ C++ C++ string vector 2.1 interpreter compiler 2.1.1 BASIC
More informationC/C++ - 文件IO
C/C++ IO Table of contents 1. 2. 3. 4. 1 C ASCII ASCII ASCII 2 10000 00100111 00010000 31H, 30H, 30H, 30H, 30H 1, 0, 0, 0, 0 ASCII 3 4 5 UNIX ANSI C 5 FILE FILE 6 stdio.h typedef struct { int level ;
More informationIO
1 C/C++ C FILE* fscanf fgets fread fprintf fputs fwrite C++ ifstream ofstream >>
More information_汪_文前新ok[3.1].doc
普 通 高 校 本 科 计 算 机 专 业 特 色 教 材 精 选 四 川 大 学 计 算 机 学 院 国 家 示 范 性 软 件 学 院 精 品 课 程 基 金 青 年 基 金 资 助 项 目 C 语 言 程 序 设 计 (C99 版 ) 陈 良 银 游 洪 跃 李 旭 伟 主 编 李 志 蜀 唐 宁 九 李 涛 主 审 清 华 大 学 出 版 社 北 京 i 内 容 简 介 本 教 材 面 向
More informationStrings
Inheritance Cheng-Chin Chiang Relationships among Classes A 類 別 使 用 B 類 別 學 生 使 用 手 機 傳 遞 訊 息 公 司 使 用 金 庫 儲 存 重 要 文 件 人 類 使 用 交 通 工 具 旅 行 A 類 別 中 有 B 類 別 汽 車 有 輪 子 三 角 形 有 三 個 頂 點 電 腦 內 有 中 央 處 理 單 元 A
More informationCC213
: (Ken-Yi Lee), E-mail: feis.tw@gmail.com 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,
More informationMicrosoft Word - 物件導向編程精要.doc
Essential Object-Oriented Programming Josh Ko 2007.03.11 object-oriented programming C++ Java OO class object OOP Ruby duck typing complexity abstraction paradigm objects objects model object-oriented
More informationuntitled
1 7 7.1 7.2 7.3 7.4 7.5 2 7.1 VFT virtual 7.1 3 1 1. 2. public protected public 3. VFT 4. this const volatile 4 2 5. ( ) ( ) 7.1 6. no-static virtual 7.2 7. inline 7.3 5 3 8. this this 9. ( ) ( ) delete
More informationextend
(object oriented) Encapsulation Inheritance Polymorphism Dynamic Binding (base class) (derived class) 1 class Base { int I; void X(); void Y(); class Derived: public Base { private: int j; void z(); Derived
More informationuntitled
3 C++ 3.1 3.2 3.3 3.4 new delete 3.5 this 3.6 3.7 3.1 3.1 class struct union struct union C class C++ C++ 3.1 3.1 #include struct STRING { typedef char *CHARPTR; // CHARPTR s; // int strlen(
More information提问袁小兵:
C++ 面 试 试 题 汇 总 柯 贤 富 管 理 软 件 需 求 分 析 篇 1. STL 类 模 板 标 准 库 中 容 器 和 算 法 这 部 分 一 般 称 为 标 准 模 板 库 2. 为 什 么 定 义 虚 的 析 构 函 数? 避 免 内 存 问 题, 当 你 可 能 通 过 基 类 指 针 删 除 派 生 类 对 象 时 必 须 保 证 基 类 析 构 函 数 为 虚 函 数 3.
More informationint *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++;
Memory & Pointer trio@seu.edu.cn 2.1 2.1.1 1 int *p int a 0x00C7 0x00C7 0x00C7 2.1.2 2 int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; 2.1.3 1. 2. 3. 3 int A,
More informationuntitled
A, 3+A printf( ABCDEF ) 3+ printf( ABCDEF ) 2.1 C++ main main main) * ( ) ( ) [ ].* ->* ()[] [][] ** *& char (f)(int); ( ) (f) (f) f (int) f int char f char f(int) (f) char (*f)(int); (*f) (int) (
More informationuntitled
1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override
More informationC/C++程序设计 - 字符串与格式化输入/输出
C/C++ / Table of contents 1. 2. 3. 4. 1 i # include # include // density of human body : 1. 04 e3 kg / m ^3 # define DENSITY 1. 04 e3 int main ( void ) { float weight, volume ; int
More informationMicrosoft Word - 01.DOC
第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的
More informationC C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40
C C trio@seu.edu.cn C C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 Week3 C Week5 Week5 Memory & Pointer
More information中 国 中 西 医 结 合 杂 志 年 月 第 卷 第 期!" 通 透 性 增 加 产 生 蛋 白 水 解 酶 促 进 血 管 内 皮 细 胞 有 丝 分 裂 内 皮 细 胞 从 基 底 膜 上 迁 移 到 血 管 周 围 间 隙 粘 附 聚 集 重 构 为 三 维 管 腔 并 与 周 围 血 管
中 国 中 西 医 结 合 杂 志 年 月 第 卷 第 期!" 学 术 探 讨 冠 心 病 的 治 疗 性 血 管 新 生 与 活 血 化 瘀 段 练 熊 兴 江 王 阶 摘 要 治 疗 性 血 管 新 生 /) '0 1/ * ' 是 冠 状 动 脉 硬 化 性 心 脏 病 * '( '/) *! / * ) '/ ' + 治 疗 的 新 策 略 而 活 血 化 瘀 治 法 对 于 + 的 基 础
More informationMicrosoft Word - 970617cppFinalSolution.doc
國 立 台 灣 海 洋 大 學 資 訊 工 程 系 C++ 程 式 設 計 期 末 考 參 考 答 案 姓 名 : 系 級 : 學 號 : 97/06/17 考 試 時 間 :10:00 12:10 試 題 敘 述 蠻 多 的, 看 清 楚 題 目 問 什 麼, 針 對 重 點 回 答 是 很 重 要 的 ; 不 確 定 的 請 一 定 要 當 場 提 出 來, 不 要 白 花 力 氣 在 誤 會
More informationebook15-C
C 1 1.1 l s ( 1 ) - i i 4. 14 - d $ l s -ldi /etc/. /etc/.. - i i 3077 drwxr-sr-x 7 bin 2048 Aug 5 20:12 /etc/./ 2 drwxr-xr-x 13 root 512 Aug 5 20:11 /etc/../ $ls -ldi /. /..... i 2 2 drwxr-xr-x 13 root
More information! "#$ %$ $ 资 料 与 方 法 $ 调 查 对 象 全 国 东 北 华 北 华 东 西 北 西 南 和 中 南 六 个 大 区 个 省 自 治 区 直 辖 市 * 个 城 市 中 的 & 所 医 院 参 加 了 本 次 调 查 各 省 省 会 城 市 的 医 学 院 校 附 属 医 院 省
! "#$ %$ $ 临 床 研 究 中 国 住 院 新 生 儿 流 行 病 学 调 查 中 华 医 学 会 儿 科 学 分 会 新 生 儿 学 组 摘 要 目 的 通 过 全 国 范 围 内 城 市 医 院 住 院 新 生 儿 的 调 查 以 了 解 我 国 目 前 住 院 新 生 儿 的 疾 病 谱 及 转 归 方 法 抽 取 全 国 个 省 和 自 治 区 的 * 个 城 市 中 的 & 所
More informationChapter12 Derived Classes
继 承 -- 派 生 类 复 习 1. 有 下 面 类 的 说 明, 有 错 误 的 语 句 是 : class X { A) const int a; B) X(); C) X(int val) {a=2 D) ~X(); 答 案 :C 不 正 确, 应 改 成 X(int val) : a(2) { 2. 下 列 静 态 数 据 成 员 的 特 性 中, 错 误 的 是 A) 说 明 静 态 数
More information一 耀 州 青 瓷 的 裝 飾 手 法 與 紋 飾 種 類 耀 州 窯 的 裝 飾 紋 樣, 豐 富 多 變, 而 且 題 材 內 容 廣 泛, 組 合 形 式 多 樣, 圖 案 形 象 優 美, 令 人 賞 心 悅 目, 並 且 反 映 了 當 時 社 會 的 審 美 趣 味 和 理 想 裝 飾
宋 代 耀 州 青 瓷 的 紋 飾 風 格 與 意 義 曾 肅 良 英 國 萊 斯 特 大 學 博 物 館 學 博 士 國 立 台 灣 師 範 大 學 美 術 研 究 所 助 理 教 授 摘 要 中 國 的 飲 茶 之 風, 興 於 唐 而 盛 於 宋, 特 別 是 宋 代 宮 廷 禁 苑 和 地 方 官 吏 文 人 學 士 的 尚 茶 崇 茶, 以 品 茶 為 雅 尚 的 觀 念 與 作 法, 使
More informationnooog
C : : : , C C,,, C, C,, C ( ), ( ) C,,, ;,, ; C,,, ;, ;, ;, ;,,,, ;,,, ; : 1 9, 2 3, 4, 5, 6 10 11, 7 8, 12 13,,,,, 2008 1 1 (1 ) 1.1 (1 ) 1.1.1 ( ) 1.1.2 ( ) 1.1.3 ( ) 1.1.4 ( ) 1.1.5 ( ) 1.2 ( ) 1.2.1
More information得 到 了 補 償. 對 於 武 姜 而 言, 莊 公 與 自 己 的 關 係 並 不 親 密, 而 共 叔 段 又 是 自 己 向 來 疼 愛 有 加 的 兒 子, 所 以, 對 莊 公 提 出 再 怎 麼 無 理 的 要 求, 武 姜 也 不 會 覺 得 有 什 麼 不 妥 之 處, 而 對 共
左 傳 - 鄭 伯 克 段 於 鄢 人 物 心 理 1021141 林 詩 倩 一. 緒 論 鄭 伯 克 段 於 鄢, 及 共 叔 段 之 亂, 是 魯 隱 公 元 年, 即 公 元 前 722 年, 春 秋 初 年 在 鄭 國 國 內 發 生 的 一 場 內 亂. 武 姜 成 為 武 公 夫 人 並 先 後 為 武 公 生 下 了 兩 個 兒 子, 長 子 莊 公 由 於 腳 先 出 來 造 成
More informationC/C++ - 字符串与字符串函数
C/C++ Table of contents 1. 2. 3. 4. 1 char C 2 char greeting [50] = " How " " are " " you?"; char greeting [50] = " How are you?"; 3 printf ("\" Ready, go!\" exclaimed John."); " Ready, go!" exclaimed
More informationEJB-Programming-3.PDF
:, JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Value Object Design Pattern J2EE Design Patterns Value Object Value Object Factory J2EE EJB Test Client
More information1911 年 武 汉 起 义, 广 东 独 立 胡 汉 民 任 总 督, 陈 任 广 东 军 政 府 外 交 部 副 部 长 陈 不 愿 做 官, 几 个 月 后 即 辞 职 1915 年 与 李 煜 堂 设 立 上 海 保 险 公 司, 陈 任 主 席 1921 年 孙 中 山 就 任 非 常 大
近 代 新 会 名 人 事 迹 张 云 田 : 新 会 县 双 水 区 人, 中 国 同 盟 会 员 华 侨 镇 南 关 起 义 烈 士 张 云 田 少 年 受 其 父 教 育, 精 通 文 翰, 其 时 深 受 外 国 嘲 笑 中 华 民 族 为 东 亚 病 夫 之 辱, 因 而 弃 文 就 武, 中 武 秀 才 中 年 时 结 交 三 合 会 兄 弟, 立 志 革 清 兴 华, 参 加 孙 中
More informationuntitled
1 5 IBM Intel 1. IBM 第 1/175 页 第 2/175 页 第 3/175 页 80 第 4/175 页 2. IBM 第 5/175 页 3. (1) 第 6/175 页 第 7/175 页 第 8/175 页 = = 第 9/175 页 = = = = = 第 10/175 页 = = = = = = = = 3. (2) 第 11/175 页 第 12/175 页 第 13/175
More informationWindows RTEMS 1 Danilliu MMI TCP/IP QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos eco
Windows RTEMS 1 Danilliu MMI TCP/IP 80486 QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos ecos Email www.rtems.com RTEMS ecos RTEMS RTEMS Windows
More informationMicrosoft PowerPoint - L17_Inheritance_v4.pptx
C++ Programming Lecture 17 Wei Liu ( 刘 威 ) Dept. of Electronics and Information Eng. Huazhong University of Science and Technology May. 2015 Lecture 17 Chapter 20. Object-Oriented Programming: Inheritance
More informationC++ 程式設計
C C 料, 數, - 列 串 理 列 main 數串列 什 pointer) 數, 數, 數 數 省 不 不, 數 (1) 數, 不 數 * 料 * 數 int *int_ptr; char *ch_ptr; float *float_ptr; double *double_ptr; 數 (2) int i=3; int *ptr; ptr=&i; 1000 1012 ptr 數, 數 1004
More information4 中 南 大 学 学 报 医 学 版 摘 要 目 的 探 讨 早 发 性 精 神 分 裂 症 患 者 在 静 息 状 态 下 是 否 存 在 脑 功 能 连 接 异 常 以 及 异 常 区 域 的 定 位 方 法 采 用 第 版 美 国 精 神 障 碍 诊 断 与 统 计 手 册 ( * ) (
中 南 大 学 学 报 医 学 版 3! + )! + - + - %$ 58: 58:7& * 1:D * $%&' 1&! & )& "# ( &!& )#% & '& '#! & #& & " ( ) 5*( )/ + ( / + + 6') * )* ) ; + *6 / + * ) *+ ' 6') * )+ * ) 6 9, * : + * ) *+ ) /+( * ( / * ) (
More information第七讲 继承与多态
第 七 章 继 承 与 派 生 1 本 章 主 要 内 容 的 继 承 成 员 的 访 问 控 制 单 继 承 与 多 继 承 派 生 的 构 造 析 构 函 数 成 员 的 标 识 与 访 问 深 度 探 索 2 的 继 承 与 派 生 的 继 承 与 派 生 保 持 已 有 的 特 性 而 构 造 新 的 过 程 称 为 继 承 在 已 有 的 基 础 上 新 增 自 己 的 特 性 而 产 生
More informationC/C++语言 - C/C++数据
C/C++ C/C++ Table of contents 1. 2. 3. 4. char 5. 1 C = 5 (F 32). 9 F C 2 1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ;
More information新・解きながら学ぶJava
481! 41, 74!= 40, 270 " 4 % 23, 25 %% 121 %c 425 %d 121 %o 121 %x 121 & 199 && 48 ' 81, 425 ( ) 14, 17 ( ) 128 ( ) 183 * 23 */ 3, 390 ++ 79 ++ 80 += 93 + 22 + 23 + 279 + 14 + 124 + 7, 148, 16 -- 79 --
More information## $%& %& ## () #) (( * (+++ () #) #) (+ (+ #) #) ( #, - #)). #))- # ( / / / 0 1 2 0 / $ # ( *. 3. 3 *..# 4 #$ 3 ( 5 ) ### 4 $ # 5, $ ## # 4 $# 5 ( %
# # $ %& $ %# ( $ # ( # $ ( $ $ ( ( % ( $ ( $ ( ( % ( % $ ( $ ( ( $ ( ( ( & ( ( ( $ ( ( % %# ( ( $ ( %# % ## $%& %& ## () #) (( * (+++ () #) #) (+ (+ #) #) ( #, - #)). #))- # ( / / / 0 1 2 0 / $ # ( *.
More information! # % % & # # % #!& % &# % &# % % % # %& ( (!& (! & & % % #!! ) %&! *& % %! % %!! # % %!! %*!& % &# % &# ) ) ( % # # ) % ( (!& (! (!! # % % #!! # ( &!
!#!#!%!&!& #!#!#!#!#!#!! #!% # ( )! & & % & ) % ( %! # )& ) &!) &!% )& )! )!!% & ( (!&!&!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! )! % * % * ( & )!! % & # %! %! )! % * % * ( & )!! % & # %! %! # )! % * % *
More information(\244j\257d\276\307\274\351_201508021-C.indd_70%.pdf)
1847-1852 1872 20 1 1896 8000 20 1896 1950 1 1896 1896 13 1900 1900 3 20 2 4 1910 1950 3 1911 1 2 3 4 1927 4 20 300 6 1906 1930 7 1911 5 1919 8 1914 9 1920 10 11 1902 200 6 12 1930 7 " # #! $! 14 15! "!
More informationKillTest 质量更高 服务更好 学习资料 半年免费更新服务
KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 310-065Big5 Title : Sun Certified Programmer for the Java 2 Platform, SE 6.0 Version : Demo 1 / 14 1. 35. String #name = "Jane Doe"; 36. int
More informationMicrosoft PowerPoint - OPVB1基本VB.ppt
大 綱 0.VB 能 做 什 麼? CH1 VB 基 本 認 識 1.VB 歷 史 與 版 本 2.VB 環 境 簡 介 3. 即 時 運 算 視 窗 1 0.VB 能 做 什 麼? Visual Basic =>VB=> 程 式 設 計 語 言 => 設 計 程 式 設 計 你 想 要 的 功 能 的 程 式 自 動 化 資 料 庫 計 算 模 擬 遊 戲 網 路 監 控 實 驗 輔 助 自 動
More informationプログラムの設計と実現II
UNIX C ls mkdir man http://www.tj.chiba-u.jp/lecture/prog2/ Ctrl+x, Ctrl+s ( )..[4]% gcc Wall o hoge hoge.c..[5]%./hoge 1 : 1 2 : 2 3 : 3 4 : 0 6..[6]% (! )..[4]% gcc Wall o hoge hoge.c..[5]%!g gcc Wall
More informationepub83-1
C++Builder 1 C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r 1.1 1.1.1 1-1 1. 1-1 1 2. 1-1 2 A c c e s s P a r a d o x Visual FoxPro 3. / C / S 2 C + + B u i l d e r / C
More informationMicrosoft PowerPoint - plan08.ppt
程 序 设 计 语 言 原 理 Principle of Programming Languages 裘 宗 燕 北 京 大 学 数 学 学 院 2012.2~2012.6 8. 面 向 对 象 为 什 么 需 要 面 向 对 象? OO 语 言 的 发 展 面 向 对 象 的 基 本 概 念 封 装 和 继 承 初 始 化 和 终 结 处 理 动 态 方 法 约 束 多 重 继 承 总 结 2012
More informationebook10-5
Oracle 7.x RDBMS 5 Oracle S Y S S Y S T E M O r a c l e 5.1 O r a c l e R D B M S O r a c l e O r a c l e 5.2 SYS SYSTEM S Y S S Y S T E M O r a c l e S Y S V $ D B A C O N N E C T R E S O U R C E S Y
More information博士 文中所谓 父伯仪少有文学 是指程仪少有文 艺天赋 与官职 文学 也没有关系 不能将此 文 学 理解为 婺州文学 从 唐朝名画录 的语义逻辑判断 遂令修己 当为 遂令伯仪 原文如下 程修己 其先冀州人 祖大历中任越州医博士 父伯仪少有文学 时周昉任越州长史 遂令伯仪师事 凡 二 十 年 中 师
李万康 华东师范大学 艺术研究所 上海 200062 [ 摘 要 ]程修己是中晚唐最杰出的宫廷画家 他于文宗大和五年 831 任集贤院画直 宣宗大中五年 851 升翰林待诏 前后衔加 浮梁尉 昭武校尉 左骁卫将军 太子中舍和荣王府长史 在唐代职官体系中 画直和画待诏都是使职而非正官 所以程修己所带系 列官衔均为寓俸禄和秩品阶的虚衔 程修己的官历显示 至少到中唐 吏部就已经确立了画直到待诏的升迁制度
More information全国计算机技术与软件专业技术资格(水平)考试
全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2008 年 上 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 试 题 一 ( 共 15 分 ) 阅 读 以 下 说 明 和 流 程 图, 填 补 流 程 图 中 的 空 缺 (1)~(9), 将 解 答 填 入 答 题 纸 的 对 应 栏 内 [ 说 明
More informationuntitled
MODBUS 1 MODBUS...1 1...4 1.1...4 1.2...4 1.3...4 1.4... 2...5 2.1...5 2.2...5 3...6 3.1 OPENSERIAL...6 3.2 CLOSESERIAL...8 3.3 RDMULTIBIT...8 3.4 RDMULTIWORD...9 3.5 WRTONEBIT...11 3.6 WRTONEWORD...12
More information本 期 导 读 : * 过 去 两 周 A 股 新 增 一 年 期 定 增 预 案 3 项, 预 计 募 集 资 金 总 额 59.73 亿 元 ( 比 上 期 减 少 7.6%); 其 中 2 亿 元 以 下 的 项 目 17 个, 融 资 规 模 为 236.75 亿, 比 上 一 期 增 加
本 期 导 读 : * 过 去 两 周 A 股 新 增 一 年 期 定 增 预 案 3 项, 预 计 募 集 资 金 总 额 59.73 亿 元 ( 比 上 期 减 少 7.6%); 其 中 2 亿 元 以 下 的 项 目 17 个, 融 资 规 模 为 236.75 亿, 比 上 一 期 增 加 55.7%;2 亿 元 以 上 的 大 额 融 资 项 目 本 期 融 资 总 规 模 413.1 亿,
More information华恒家庭网关方案
LINUX V1.5 1 2 1 2 LINUX WINDOWS PC VC LINUX WINDOWS LINUX 90% GUI LINUX C 3 REDHAT 9 LINUX PC TFTP/NFS http://www.hhcn.com/chinese/embedlinux-res.html minicom NFS mount C HHARM9-EDU 1 LINUX HHARM9-EDU
More information議 程 前 發 言 冀 新 官 上 任 燒 好 三 把 火 用 好 三 盆 水 陳 明 金 2014 年 11 月 18 日 澳 門 特 區 政 府 即 將 換 屆, 各 種 傳 聞 令 廣 大 居 民 感 覺 到, 絕 大 部 份 主 要 官 員 都 會 換 人 雖 然 他 們 對 人 選 無 話
促 重 整 運 輸 部 門 冀 革 新 交 通 政 策 鄭 安 庭 議 員 議 程 前 發 言 2014 年 11 月 18 日 主 席 各 位 同 事 : 今 天 我 的 議 程 前 發 言 題 目 是 : 促 重 整 運 輸 部 門 冀 革 新 交 通 政 策 剛 剛 完 成 的 第 61 屆 澳 門 格 蘭 披 治 大 賽 車 令 到 遊 客 絡 繹 不 絕 的 澳 門 更 為 熱 烈, 關
More informationMicrosoft Word - 97.01.30軟體設計第二部份範例試題_C++_ _1_.doc
電 腦 軟 體 設 計 乙 級 技 術 士 技 能 檢 定 術 科 測 試 範 例 試 題 (C++) 試 題 編 號 :11900-920201-4 審 定 日 期 : 94 年 7 月 1 日 修 訂 日 期 : 96 年 2 月 1 日 97 年 1 月 30 日 ( 第 二 部 份 ) 電 腦 軟 體 設 計 乙 級 技 術 士 技 能 檢 定 術 科 測 試 應 檢 參 考 資 料 壹 試
More informationMicrosoft Word - CPE考生使用手冊160524.docx
大 學 程 式 能 力 檢 定 (CPE) 考 生 使 用 手 冊 2016 年 5 月 24 日 這 份 手 冊 提 供 給 參 加 CPE 檢 定 考 試 的 考 生 內 容 包 含 考 試 環 境 的 使 用, 以 及 解 題 時 所 使 用 I/O 的 基 本 知 識 1. 如 欲 報 名 參 加 CPE 考 試, 請 先 於 CPE 網 站 完 成 帳 號 註 冊, 然 後 再 報 名 該
More informationebook50-15
15 82 C / C + + Developer Studio M F C C C + + 83 C / C + + M F C D L L D L L 84 M F C MFC DLL M F C 85 MFC DLL 15.1 82 C/C++ C C + + D L L M F C M F C 84 Developer Studio S t u d i o 292 C _ c p l u s
More information概述
OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3
More informationebook
3 3 3.1 3.1.1 ( ) 90 3 1966 B e r n s t e i n P ( i ) R ( i ) W ( i P ( i P ( j ) 1) R( i) W( j)=φ 2) W( i) R( j)=φ 3) W( i) W( j)=φ 3.1.2 ( p r o c e s s ) 91 Wi n d o w s Process Control Bl o c k P C
More information中国管理科学 年 -- 及其价 差 偏 离 程 度被 广 泛 应 用 于 配 对 策 略 构 造 ) 欧式距离以距离最 小 为 依 据 构 建 最 佳 配 对 交 易 组 合以避免同一 股 票 同 时 被 买 入 和 卖 空 的 风 险 在 例如 将协整配对法应 V ) W0)I 0等
第 卷 第 期 中 国 管 理 科 学 年 月 ' 文 章 编 号 )* +,-/0)1 融 资 融 券 背 景 下 证 券 配 对 交 易 策 略 研 究 基 于 协 整 和 距 离 的 两 阶 段 方 法 胡 伦 超 余 乐 安 汤 铃 中 国 科 学 院 数 学 与 系 统 科 学 研 究 院 北 京 北 京 化 工 大 学 经 济 管 理 学 院 北 京 * 摘 要 国 内 融 资 融 券
More informationebook140-9
9 VPN VPN Novell BorderManager Windows NT PPTP V P N L A V P N V N P I n t e r n e t V P N 9.1 V P N Windows 98 Windows PPTP VPN Novell BorderManager T M I P s e c Wi n d o w s I n t e r n e t I S P I
More informationebook39-5
5 3 last-in-first-out, LIFO 3-1 L i n e a r L i s t 3-8 C h a i n 3 3. 8. 3 C + + 5.1 [ ] s t a c k t o p b o t t o m 5-1a 5-1a E D 5-1b 5-1b E E 5-1a 5-1b 5-1c E t o p D t o p D C C B B B t o p A b o
More information<4D6963726F736F667420576F7264202D20A4D5A46CA1D0A740A4E5A5FEB6B02E646F63>
我 讀 孔 子 ( 第 六 屆 ) 征 文 比 賽 獲 獎 作 文 選 集 澳 門 人 文 科 學 學 會 主 辦 澳 門 基 金 會 教 育 暨 青 年 局 贊 助 2008 11 1 一 等 獎 ( 以 下 以 下 按 照 學 校 筆 劃 順 序 排 列 ) 將 心 比 心, 推 己 及 人 王 錦 江 ( 培 正 中 學 ) 己 所 不 欲, 勿 施 於 人 聖 人 孔 子 這 句 只 有 八
More information口 的 70% 连 南 县 的 瑶 族. 有 排 瑶 过 山 瑶 排 瑶 6 万 多 人 住 在 三 排 南 岗 i 雨 水 大 麦 山 大 坪 香 坪 盘 石 金 坑 8 个 乡 镇. 形 成 了 占 全 县 面 积 80% 的 聚 居 地 << 连 州 志 } 卷 八 排 瑶 志 曰 在 连 者
居 住 地 域 与 文 化 变 迁 一 一 以 广 东 瑶 族 为 例 赵 家 旺 * 中 国 是 个 多 民 族 国 家. 共 有 56 个 民 族. 其 中 少 数 民 族 有 归 个 根 据 1990 年 的 人 口 普 查. 全 国 总 人 口 11 亿 3 千 多 万 人. 汉 族 10 忆 4 千 多 万 人. 占 全 国 总 人 口 的 90% 多. 少 数 民 族 人 口 不 到 10%
More informationebook8-30
3 0 C C C C C C++ C + + C++ GNU C/C++ GNU egcs UNIX shell s h e l l g a w k P e r l U N I X I / O UNIX shell awk P e r l U N I X C C C C C C U N I X 30.1 C C U N I X 70 C C U N I X U N I X U N I X C Dennis
More informationMicrosoft Word - d.doc
我 看 > 之 感 想 7B 蔡 進 軍 電 視 連 續 劇 在 校 園 出 現 了 一 股 熱 潮 現 象 同 學 們 無 論 在 小 息 或 午 膳 時 間 爭 相 討 論 項 羽 劉 邦 的 英 雄 氣 概 這 現 象 形 成 了 一 種 風 氣, 一 種 誘 惑, 什 至 是 壓 力 不 看 似 乎 是 一 大 憾 事, 到 底 該 劇 有
More information(procedure-oriented)?? 2
1 (procedure-oriented)?? 2 (Objected-Oriented) (class)? (method)? 3 : ( 4 ???? 5 OO 1966 Kisten Nygaard Ole-Johan Dahl Simula Simula 爲 6 Smalltalk Alan Kay 1972 PARC Smalltalk Smalltalk 爲 Smalltalk 爲 Smalltalk
More informationMicrosoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc
2 5 8 11 0 13 1. 13 2. 15 3. 18 1 23 1. 23 2. 26 3. 28 2 36 1. 36 2. 39 3. 42 4. 44 5. 49 6. 51 3 57 1. 57 2. 60 3. 64 4. 66 5. 70 6. 75 7. 83 8. 85 9. 88 10. 98 11. 103 12. 108 13. 112 4 115 1. 115 2.
More information51 C 51 isp 10 C PCB C C C C KEIL
http://wwwispdowncom 51 C " + + " 51 AT89S51 In-System-Programming ISP 10 io 244 CPLD ATMEL PIC CPLD/FPGA ARM9 ISP http://wwwispdowncom/showoneproductasp?productid=15 51 C C C C C ispdown http://wwwispdowncom
More informationC 1
C homepage: xpzhangme 2018 5 30 C 1 C min(x, y) double C // min c # include # include double min ( double x, double y); int main ( int argc, char * argv []) { double x, y; if( argc!=
More information前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii
前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii C# 7 More Effective C# C# C# C# C# C# Common Language Runtime CLR just-in-time
More informationuntitled
1 1.1 1.2 1.3 1.4 1.5 ++ 1.6 ++ 2 BNF 3 4 5 6 7 8 1.2 9 1.2 IF ELSE 10 1.2 11 1.2 12 1.3 Ada, Modula-2 Simula Smalltalk-80 C++, Objected Pascal(Delphi), Java, C#, VB.NET C++: C OOPL Java: C++ OOPL C# C++
More informationuntitled
8086/8088 CIP /. 2004.8 ISBN 7-03-014239-X.... TP313 CIP 2004 086019 16 100717 http://www.sciencep.com * 2004 8 2004 8 1 5 500 787 1092 1/16 16 1/2 391 000 1 2 ii 1 2 CAI CAI 3 To the teacher To the student
More informationchp6.ppt
Java 软 件 设 计 基 础 6. 异 常 处 理 编 程 时 会 遇 到 如 下 三 种 错 误 : 语 法 错 误 (syntax error) 没 有 遵 循 语 言 的 规 则, 出 现 语 法 格 式 上 的 错 误, 可 被 编 译 器 发 现 并 易 于 纠 正 ; 逻 辑 错 误 (logic error) 即 我 们 常 说 的 bug, 意 指 编 写 的 代 码 在 执 行
More informationebook12-1
API N e t B I O S Wi n s o c k A P I Wi n s o c k 1 N e t B I O S Wi n s o c k A P I N e t B I O S O S / 2 D O S 2 3 4 Wi n d o w s Wi n d o w s 1 NetBIOS Network Basic Input/Output System, NetBIOS A P
More information2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf ("%d", & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf ("%d %d
2013 18 ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp, Compilation Error cin scanf Time Limit Exceeded 1: A 5 B 5 C 5 D 5 E 5 F 5 1 2013 C 1 # include 2 int main ( void ) 3 { 4 int cases, a, b,
More information1 2005 9 2005,,,,,,,,,, ( http: \ \ www. ncre. cn,, ) 30,,,,,,,, C : C : : 19 : 100081 : : 7871092 1 /16 : 8. 75 : 96 : 2005 11 1 : 2005 11 1 : ISBN 7
1 2005 9 2005,,,,,,,,,, ( http: \ \ www. ncre. cn,, ) 30,,,,,,,, C : C : : 19 : 100081 : : 7871092 1 /16 : 8. 75 : 96 : 2005 11 1 : 2005 11 1 : ISBN 7-80097 - 564-9 /TP 8 : 10. 00 ,,,, 1994 NCRE,,, ( ),,,,,
More information第 期 熊 安 萍 等 *1$ 文 件 系 统 中 范 围 锁 机 制 的 应 用 研 究! 锁 命 名 空 间 '+'($($ 描 述 了 资 源 和 锁 的 集 合 它 同 时 在 客 户 节 点 和 服 务 节 点 存 在 不 同 之 处 只 是 利 用 一 个 数 据 标 识 来 有 效 区
第 卷 第 期 重 庆 邮 电 大 学 学 报 自 然 科 学 版 年 月!"#$" %$&'$ ''())$($*($'('+$$,-./0 1' 文 件 系 统 中 范 围 锁 机 制 的 应 用 研 究 熊 安 萍 葛 军 邹 洋 重 庆 邮 电 大 学 计 算 机 科 学 与 技 术 学 院 重 庆! 摘 要 分 布 式 锁 机 制 是 分 布 式 文 件 系 统 的 重 要 机 制 *1$
More information内 容 提 要 指 针 持 久 动 态 内 存 分 配 字 符 串 ( 字 符 数 组 ) 2
第 六 讲 指 针 与 字 符 串 1 内 容 提 要 指 针 持 久 动 态 内 存 分 配 字 符 串 ( 字 符 数 组 ) 2 指 针 什 么 是 指 针 指 针 的 定 义 与 运 算 指 针 与 一 维 数 组 指 针 数 组 行 指 针 与 二 维 数 组 指 针 与 引 用 指 针 与 函 数 3 指 针 定 义 什 么 是 指 针 指 针 变 量, 简 称 指 针, 用 来 存 放
More informationuntitled
不 料 料 例 : ( 料 ) 串 度 8 年 數 串 度 4 串 度 數 數 9- ( ) 利 數 struct { ; ; 數 struct 數 ; 9-2 數 利 數 C struct 數 ; C++ 數 ; struct 省略 9-3 例 ( 料 例 ) struct people{ char name[]; int age; char address[4]; char phone[]; int
More information.' 6! "! 6 "'' 6 7% $! 7%/'& 人 类 非 洲 锥 虫 病 又 称 昏 睡 病 是 布 氏 锥 虫 冈 比 亚 亚 种!! 或 布 氏 锥 虫 罗 得 西 亚 种 "#$$ %! &'!!! 感 染 引 起 的 一 种 寄 生 虫 病 以 采 采 蝇! 为 传 播 ' 媒
) 文 章 编 号 '.')) 论 著!"#$%&' ' ' ' ' '!"# ' $%& ' ' '8 目 的 对 ' 例 输 入 性 非 洲 锥 虫 病 患 者 进 行 实 验 室 诊 断 与 病 原 体 鉴 定 方 法 收 集 患 者 的 临 床 发 病 与 流 行 病 学 调 查 资 料 采 集 血 样 脑 脊 液 瑞 氏 吉 氏 染 色 涂 片 后 镜 检 用 布 氏 锥 虫 表 达 位
More information1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10
Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1
More informationStrings
Polymorphism and Virtual Functions Cheng-Chin Chiang Virtual Function Basics 多 型 (Polymorphism) 賦 予 一 個 函 數 多 種 意 涵, 存 在 於 同 一 類 別 之 內 祖 先 類 別 與 後 代 類 別 間 物 件 導 向 程 式 設 計 基 本 原 理 虛 擬 函 數 (Virtual Function)
More informationMicrosoft Word - chap10.doc
78 10. Inheritance in C++ 我 們 已 介 紹 了 物 件 導 向 程 式 的 第 一 個 主 要 特 性, 即 程 式 可 模 組 化 成 為 類 別 ( 物 件 ), 類 別 具 有 資 料 封 裝 的 特 性 接 下 來 我 們 要 介 紹 物 件 導 向 程 式 的 另 一 個 主 要 特 性, 那 就 是 類 別 具 有 繼 承 的 功 能 繼 承 就 是 重 複
More information教2012-1 0020
教 务 字 [2012] 14 号 关 于 印 发 第 35 次 全 国 计 算 机 等 级 考 试 ( 江 西 中 医 学 院 考 点 ) 秩 序 册 暨 工 作 人 员 培 训 的 通 知 ḇ1 主 题 词 : 第 35 次 抄 报 : 学 院 领 导 江 西 中 民 主 学 院 J 笠 垒 生!L 全 国 计 算 机 等 级 考 试 教 务 字 [2012J53 号 关 于 印 发 ((2012
More information科学计算的语言-FORTRAN95
科 学 计 算 的 语 言 -FORTRAN95 目 录 第 一 篇 闲 话 第 1 章 目 的 是 计 算 第 2 章 FORTRAN95 如 何 描 述 计 算 第 3 章 FORTRAN 的 编 译 系 统 第 二 篇 计 算 的 叙 述 第 4 章 FORTRAN95 语 言 的 形 貌 第 5 章 准 备 数 据 第 6 章 构 造 数 据 第 7 章 声 明 数 据 第 8 章 构 造
More information( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023)
( CIP) /. :, 2005. 2 ( ) ISBN 7-5624-3339-9.......... TP311. 1 CIP ( 2005) 011794 : : : : * : : 174 ( A ) :400030 : ( 023) 65102378 65105781 : ( 023) 65103686 65105565 : http: / /www. cqup. com. cn : fxk@cqup.
More informationMicrosoft Word - 11.doc
除 錯 技 巧 您 將 於 本 章 學 到 以 下 各 項 : 如 何 在 Visual C++ 2010 的 除 錯 工 具 控 制 下 執 行 程 式? 如 何 逐 步 地 執 行 程 式 的 敘 述? 如 何 監 看 或 改 變 程 式 中 的 變 數 值? 如 何 監 看 程 式 中 計 算 式 的 值? 何 謂 Call Stack? 何 謂 診 斷 器 (assertion)? 如 何
More information# # # # # # # # # % # & # & # # # () # (( # * * (( # (+ # ( (# # (# # (# # ( # ( +) (
# # # # # # # # # % # & # & # # # () # (( # * * (( # (+ # ( (# # (# # (# # ( # ( +) ( # +) # +( # ++ # + + # + # +# # + # +% +& # +& # + # + # ) ( # ( # + # # # # # # ) ( # + # # # # + # # # # # # #
More informationebook39-6
6 first-in-first-out, FIFO L i n e a r L i s t 3-1 C h a i n 3-8 5. 5. 3 F I F O L I F O 5. 5. 6 5. 5. 6.1 [ ] q u e n e ( r e a r ) ( f r o n t 6-1a A 6-1b 6-1b D C D 6-1c a) b) c) 6-1 F I F O L I F ADT
More information/0/ "!!!!! " "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " # $ % && $ $ $ $ ( $ $ ( $ ) % * ( * $ $ $ $ $ $ $ ( $ $ $ $ $ # ( $ $ ( $ $ $ ( $ $ $ $
"!!!!!!!!! " "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " # $ /0/ "!!!!! " "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " # $ % && $ $ $ $ ( $ $ ( $ ) % * ( * $ $ $
More information6 22 22 23 23 24 24 1., 2., 3., 24 26 26 28 30 31 31 31 32 32 34 34 1. 2., 3.,, 34 37 37 39 40 43 44 2
1 1 1., 2.,, 3., 1 3 3 5 7 9 11 11 12 12 13 13 1., 2.,, 3., 13 15 15 18 19 21 1 6 22 22 23 23 24 24 1., 2., 3., 24 26 26 28 30 31 31 31 32 32 34 34 1. 2., 3.,, 34 37 37 39 40 43 44 2 44 45 45 47 1., 2.
More information人 才 培 养 与 专 业 建 设 人 才 培 养 与 专 业 建 设 首 都 师 范 大 学 重 点 专 业 培 育 与 建 设 计 划 实 施 办 法 校 发 号 根 据 首 都 师 范 大 学 十 二 五 时 期 本 科 专 业 建 设 与 发 展 规 划 安 排 为 进 一 步 加 强 学 校 本 科 人 才 培 养 工 作 加 大 专 业 建 设 力 度 提 升 专 业 建 设 水 平
More information(2) 廠 商 具 有 維 修 維 護 或 售 後 服 務 能 力 之 證 明 ;(3) 廠 商 具 有 製 造 供 應 或 承 做 能 力 之 證 明 ;(4) 具 有 相 當 人 力 之 證 明 屬 特 定 資 格 之 ㄧ 8.(3) 機 關 辦 理 預 算 金 額 為 新 台 幣 四 億 元
政 府 採 購 法 規 概 要 題 庫 最 後 更 新 日 期 :( 人 發 局 第 一 期 ) 2010/03/20 選 擇 題 : ( 答 案 ) 正 確 錯 誤 解 析 1.(3) 機 關 訂 定 招 標 文 件, 何 者 正 確?(1) 廠 商 履 行 契 約 所 必 須 具 備 之 財 務 商 業 或 技 術 資 格 條 件, 不 考 慮 廠 商 在 外 國 之 商 業 活 動 應 (2)
More information第 一 部 分 增 城 区 人 力 资 源 和 社 会 保 障 局 概 况 一 广 州 市 增 城 区 人 力 资 源 和 社 会 保 障 局 主 要 职 能 广 州 市 增 城 区 人 力 资 源 和 社 会 保 障 局 是 区 委 区 政 府 主 管 人 事 人 才 劳 动 社 会 保 障 的
广 州 市 增 城 区 人 力 资 源 和 社 会 保 障 局 2016 年 部 门 预 算 目 录 第 一 部 分 广 州 市 增 城 区 人 力 资 源 和 社 会 保 障 局 概 况 一 部 门 主 要 职 能 二 部 门 预 算 单 位 构 成 三 部 门 人 员 构 成 第 二 部 分 2016 年 部 门 预 算 安 排 情 况 说 明 第 三 部 分 2016 年 部 门 预 算 报
More information论 文 :?,,,,,,,,,, (, ),, ( ),,,,,,,, (, ) : (, ),,, :,, ;,,,,
:? * 珠 江 三 角 洲 农 民 工 工 资 的 决 定 模 型 刘 林 平 张 春 泥 : 本 文 通 过 对 珠 江 三 角 洲 农 民 工 问 卷 调 查 资 料 的 回 归 分 析, 构 建 了 一 个 决 定 农 民 工 工 资 水 平 的 模 型 本 文 发 现, 人 力 资 本 中 的 教 育 年 限 培 训 工 龄 等 变 量 对 农 民 工 工 资 有 显 著 的 正 向 影
More information