|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
class CA$ `) M. T& M0 i/ F* _! t& n% n
{
' o% v5 Y ?4 e9 A# rpublic: H/ t- E2 T% W3 _! d/ L$ z. S9 J; _
CA(int ,int );
8 d, U% C) E1 E ~CA();
0 T7 @0 e d2 l3 c, v9 L9 k/ ]: Q8 W6 B- ]& K2 f3 _, f
private:
, e. D* q) B; m7 e const int num;
5 O; J3 ~" W2 X1 C5 @$ E( T int &mum;* m, r- ]" a3 A2 _8 {7 i
};
. }& q! m$ B9 _7 C, L/ A
& ^& Y4 I# T K& U# v: T3 [7 ? qCA::CA(int x,int y):num(x),mum(y)
! a0 U! e1 q' Z+ T5 ~1 s{
" k( o# o1 e9 C. S# S cout<<num<<","<<mum<<endl;
+ ]" n3 b0 e" `8 Q/ V# H}
+ P8 E9 C4 t6 g# i' E8 V E& Z6 G# C* n* E! d( u1 w
CA::~CA()8 ^3 ]$ C; A2 w d# ~. S' V
{
9 T Y' X o+ l; y' m}
+ U% ^% x$ z5 W% w; Z. M
; r* t) T/ o3 e `' g& z4 s#include <iostream>3 S4 i$ ]5 f5 j
) g) |2 v+ r3 ^. [using namespace std;
- ?* U, R" x' W l L/ x
) T, s7 [+ S7 s/ U+ F) g% A#include "成员变量的初始化与构造函数1.h"
; r3 I$ `1 t& f; [" t! I" D# c: |0 \# Y( W1 A4 h k
int main(void)$ m0 x0 D; Y( w5 R- ^6 |9 \
{
) C# }6 c; G8 d9 i8 B2 t CA a(2,3);! m& f) B/ v2 z+ h+ y* j9 f# V
% j9 R( v9 ?# M5 O) |
return 0;
6 o& m* x1 ], d1 Y8 L} |
|