|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
class CA
3 F" X3 N3 w) Z{6 E7 ^6 P! `2 Y0 X# L1 s
public:
8 w, L/ }$ P6 }) G" L5 s CA(int ,int );
2 y; n+ W0 t3 O8 ^' X8 G) R4 D ~CA();& v, d4 L/ q( `4 C$ r- Z A( C
+ k$ i& |7 {% \, U( Bprivate:
. c' T$ u8 \9 F; @" l const int num;
4 u; a5 ]- ^; H6 @ w int &mum;
! | Q4 V% P H};7 n' B+ v( |2 m$ p* a. _
( t% H: {; [" W) W7 x6 {& gCA::CA(int x,int y):num(x),mum(y)
/ U( b" y, b/ F" B# i( h' ~{
$ O Y* O! @/ g2 \4 y. e) A2 f" f cout<<num<<","<<mum<<endl;) y) S! ^. x4 u4 G7 c* y) ~( S( Q, t6 z
}% V, R+ r# V/ Q# H- P3 n! {3 R
2 U7 A/ t6 G: Z
CA::~CA()
# G8 D. t, r6 V# d4 Z* n$ i; q{
. {, R* F B+ d% w7 F}
6 d: x. D6 K- r- q" _% e/ f3 d4 N0 s1 G# y& p
#include <iostream>. b6 O% `4 V V* K' Y; E
% w$ S0 K9 q: W. Gusing namespace std;
# Y. g" v% j* P' N# Q1 O- y) e. G" U
#include "成员变量的初始化与构造函数1.h": T* ]/ `9 H7 C' b/ D/ M
1 U/ `: o; @% T2 nint main(void)
8 K% D6 z* I& [$ f5 t, I/ p2 {) W3 l+ {{
7 K w; k8 `: x7 ^& E5 x# c CA a(2,3);
3 U5 d3 t" R& J/ @1 N6 U! F$ |8 L( e. m" m1 I# I0 J
return 0;
4 n( |$ v. F) {} |
|