🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.lang.java
Article #12568

Re: java�еĴ�ֵ�ʹ�����

#12568
From: NUE
Date: Sun, 25 Jul 2004 17:01
31 lines
2104 bytes
������������5
��Ϊt = new T(10)��ʱ��t�Ѿ��������µĵ�ַ����a�ĵ�ַ�޹ء�
�ȼ�������c���ԣ�
func(_type *t)
..
_type *a = (_type *)malloc(sizeof(_type));
a->i = 5;
func(a); /* ��ʱ t == a */
  /* func�ڲ�: t = (_type *)malloc(sizeof(_type))
     t ��ָ���µĵ�ַ */
���ʱ��t���κβ�������a�޹ء�

����԰ѳ���ij�t.i = 10������
��ʵthinking in java����Դ�ֵ���Ǵ����ý��ú���ȷ�ˡ�
��Ҫ��ֵ��ʱ��Ӧ�õ���Object.clone()��������ʵ����������ֻ�����ڴ��︴����һ
�飬ʵ�ʴ��ݵĻ���ָ�룬ֻ����ָ���µ��ڴ�ȥ�ˡ�

�� �� xeon.bbs@bbs.nankai.edu.cn (98CS~��è~�����Կ�����) �Ĵ������ᵽ: ��
: �����˵��������ָ��ʵ�ֵģ������㲻��˵java���ݵ���ָ�롣
: ����ٸ����ӣ�
: class T{
:     public int i;
:     public T( int i ) { this.i = i; }
: }
: public class Test{
:     public static void func( T t )
:     {
:             t = new T( 10 );
: .................������ʡ�ԣ�
--
�� ��Դ:����ˮ˼Դ bbs.sjtu.edu.cn��[FROM: 218.138.92.80]
Technical Details
Message-ID: <4DN2Il$A0I@bbs.sjtu.edu.cn>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nntp-server.pubsub.com!netnews.sdu.edu.cn!SJTU

Show Full Headers
Complete Article Headers
X-Google-Thread: f6cb0,148db713ed371ece
X-Google-Attributes: gidf6cb0,public
X-Google-Language: Chinese,GB
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nntp-server.pubsub.com!netnews.sdu.edu.cn!SJTU
From: nue.bbs@bbs.sjtu.edu.cn (NUE)
Newsgroups: cn.bbs.comp.lang.java
Subject: Re: java�еĴ�ֵ�ʹ�����
Date: 25 Jul 2004 17:01:24 GMT
Organization: ��ˮ˼Դ
Message-ID: <4DN2Il$A0I@bbs.sjtu.edu.cn>
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: Java/M.1090774415.A
Lines: 31