Article View: cn.bbs.comp.lang.java
Article #12399Re: java�еĴ�ֵ�ʹ�����
From: 98CS~��è~�����Կ�����
Date: Tue, 27 Jul 2004 08:35
Date: Tue, 27 Jul 2004 08:35
41 lines
2970 bytes
2970 bytes
�ϼ��ݴ�ѧ�ı��뽲�壺
Call by Value
IN mode:
- can't have an effect on caller vars
unless value passed is a pointer (C) or reference (Java)
- used by many languages, incl.: C/C++, Java, Cool
How it works:
- Formal parameter is just like a local name: storage of
formals in activation record of called proc.
- Caller evaluates the actual params and sticks their Rvalues
in the storage for the formals
Note: this is the mechanism we�ve been describing
when discussing code gen of function calls
ָ�벻�������ã�ǧ��Ҫ�����������Ҳ��������������ȥ�ˡ�
��ݽ���˭Ҫ�ҿ���������
�� �� nue.bbs@bbs.sjtu.edu.cn (NUE) �Ĵ������ᵽ: ��
: no, ��������ȫ��ͬ����ʵ����Ӧ�ö���
: struct T {
: int i;
: };
: ���� int *p
: ��Ϊp�������һ�����á�����һ����ʽ���ݡ�
: ����Ҫ����һ�㣬c��������û�����ô�����һ˵���ģ����в�����pass by value��
: ����ָ�롣pass by reference��c++�ĸ��c++�а�c��ָ���һ���ֹ�������Ϊpass
: by reference���������㴫����struct���?��ô���ڴ��л�copy���struct�ĸ���
: ����pass by reference�ĸ�����ȡstruct�ĵ�ַ���ݸ���Ȼ���ں����ڲ������ø�
: .................������ʡ�ԣ�
--
[1;33;44m My [31mHeart [33mWill Go On [31m.��*��. [m
[1;31;44m . *�� *.* �� [m
[1;31;44m �� * [m
[1;31;44m �� .�� [m
[1;31;44m ��*. �� . [m
[1;31;44m �� . . [1;4;32;44mJowtte@hotmail.com[m[44m [m
[m[1;33m�� ��Դ:���Ұ��Ͽ�վ nkbbs.org��[FROM: 202.108.245.163][m
Technical Details
Message-ID:
<4DOGBV$9yH@bbs.nankai.edu.cn>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!nntp-server.pubsub.com!maily.cic.tsinghua.edu.cn!news2.happynet.org!NanKaiShow Full Headers
Complete Article Headers
X-Google-Thread: f6cb0,a1251c832f18f12d X-Google-Attributes: gidf6cb0,public X-Google-Language: ENGLISH,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!nntp-server.pubsub.com!maily.cic.tsinghua.edu.cn!news2.happynet.org!NanKai From: xeon.bbs@bbs.nankai.edu.cn (98CS~��è~�����Կ�����) Newsgroups: cn.bbs.comp.lang.java Subject: Re: java�еĴ�ֵ�ʹ����� Date: 27 Jul 2004 08:35:19 GMT Organization: �Ұ��Ͽ�վ Message-ID: <4DOGBV$9yH@bbs.nankai.edu.cn> X-Filename: Java/M.1090916911.A Lines: 41