Path: chuka.playstation.co.uk!news1.scei.co.jp!usenet From: bo0wy@t3.rim.or.jp (Hideki Naito(bo0wy)) Newsgroups: playstation.ny.program.labo Subject: Re: GCC++=?ISO-2022-JP?B?GyRCJE49aTR8Mj0kRCQkJEYbKEI=?= Date: Sat, 26 Apr 1997 16:20:35 +0900 Organization: PlayStation Net Yarouze Lines: 38 Message-ID: References: <01bc4ff3$89f95f80$5410dbca@default> <01bc5059$ac5515e0$9d36d4ca@pbc00426.niftyserve.or.jp> <01bc50c8$3278f380$LocalHost@default> <3360DB0F.AA74F82A@aix.or.jp> NNTP-Posting-Host: 202.247.160.229 Mime-Version: 1.0 Content-Type: Text/Plain; charset=ISO-2022-JP X-Posting-Software: WSNews 2.017 playstation.ny.program.labo の <3360DB0F.AA74F82A@aix.or.jp> の 記事において 1997年04月26日(土) 01時25分51秒頃、 Youhei TAKADA さんは書きました。 >で,その後ちょっと調べたらメンバ変数の初期化は次のようにする >のがC++風のようです。 > >class test >{ >public: > long b; > long c; > > test(int i=0,int j=0) : b(i),c(j){ } >}; なんか思いっきり勘違いされてる様な・・ 「 : ほにゃらら〜」の部分は、基底クラスに引数を渡す時に 使用します。こんな感じ class base { int i; public: base(int x) { i = x; } }; class test : pubic base { int j; pulibc: test(int x, int y) : base(y) { j = x; } }; ---  内藤 英樹 <-> 暴威 E-mail : bo0wy@t3.rim.or.jp  (Net Yaroze! : aza02223) Nifty : CQC00075@niftyserve.or.jp