🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.program
Article #1445

Re: ����

#1445
From: ��ҹ����
Date: Thu, 09 Apr 1998 00:00
45 lines
1949 bytes
> ==> Yan_Yi(�޶�)                             ˵��: 
>      �������������һ���� 
>      class CString{ 
>            char * m_pBuffer; 
>            int    m_nLength; 
>           public: 
>                  CString(char c,int l=1) 
										  ^^^^^^^
	����������ܱ���ͨ����//thinkhard
>                 ~CString(){if(m_nLength!=0)delete m_pBuffer;}; 
>        friend    ostream & operator<<(ostream &,CString&) 
														^^^^
>            } 
>        CString::SCtring(char c,int l) 
                 ^^^^^^^^^^
>        { 
>          m_nLength=l; 
>          if(l!=0){ 
>            m_pBuffer=new char [l+1]; 
>            setmem(m_pBuffer,l,'c'); 
>            m_pBuffer[l]=0; 
>            } 
>         } 
>        ostream & operator<<(ostream & o,CString &s) 
>        { 
>          o<<s.m_pBuffer; 
>          return o; 
>        } 
>  �����ǵ��õ���ģ�� 
>   void main() 
>   { 
>     CString s('0'); 
>     cout<<s; 
>   } 
>   ������:�ٵ���cout<<s֮ǰ,s������������,���cout���Dz�������� 
>   ����Ϊʲô?�������ָ�� 
 
--
��ӭʹ��У��FTP��ѯ���棺
http://202.38.79.1/~yflei
     ������ҹ������      
     ��������������      

�� ��Դ: �й�ƴ�BBSվ [bbs.ustc.edu.cn]
Technical Details
Message-ID: <980409.yNCpz$PBBS@bbs.ustc.edu.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: fc86e,2c2c62ad4768217f,start
X-Google-Attributes: gidfc86e,public
From: Simon_Lei@bbs.ustc.edu.cn (��ҹ����)
Subject: Re: ����
Date: 1998/04/09
Message-ID: <980409.yNCpz$PBBS@bbs.ustc.edu.cn>
X-Deja-AN: 342468056
Organization: �й�ƴ�BBSվ
Newsgroups: cn.bbs.comp.program