473,499 Members | 1,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

beginner's question regarding pass parameter

pass by value is:
declare with:
function(class a)
call with:
function(a)
and a is COPIED

pass by reference is
declare with:
function(class *a)
called with:
function(&a);
and a pointer of a is COPIED, but only one copy of a in memory

pass by (what's the third one???) is:
declare with:
function(class& a);
called with
function(a);
and a pointer is passed, only one copy in memory...

IS THIS CORRECT?
Jul 19 '05 #1
1 2105
"Matthew Monopole" <ma*******@hotmail.com> wrote in message
news:de*****************@newsread2.prod.itd.earthl ink.net...
pass by value is:
declare with:
function(class a)
call with:
function(a)
and a is COPIED
Right.
pass by reference is
declare with:
function(class *a)
Actually, this is passing by /pointer/. myclass* is a
pointer-to-myclass.
called with:
function(&a);
and a pointer of a is COPIED, but only one copy of a in memory
Right.
pass by (what's the third one???) is:
declare with:
function(class& a);
This would then be passing by /reference/. myclass& is a
reference-to-myclass.
called with
function(a);
and a pointer is passed, only one copy in memory...


Right.

hth
--
jb

(replace y with x if you want to reply by e-mail)
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
3455
by: J.R. | last post by:
Hi folks, The python can only support passing value in function call (right?), I'm wondering how to effectively pass a large parameter, such as a large list or dictionary? It could achieved...
15
1982
by: Pelle Beckman | last post by:
Hi all, I have a few newbie questions: In function declaration what does a 'const' mean inside the parameter list ? That it won't modify the value? void MemberFunction(const int x);
8
1348
by: Paminu | last post by:
I am trying to split my program in different parts. I have a file called mainfile.c that contains the main() function, some global variables and a few other functions. I then have a file...
1
2590
by: Mike Malter | last post by:
I am just starting to work with reflection and I want to create a log that saves relevant information if a method call fails so I can call that method again later using reflection. I am...
3
1131
by: Gopal Prabhakaran | last post by:
Dear All, I have 1 class namley classa classa has a method which need a parameter as class methods How shall i pass class method as parameter to another class method. Pls help me asap ...
6
1461
by: enjoying the view | last post by:
I am working on a school project, trying to build a simple RPC stub generator. The idea is that the generator takes a normal python file with functions defined in it and produces a client and...
4
1314
by: 3rdshiftcoder | last post by:
hi- i am having trouble using parameter values in my function and to be honest a little trouble with member variables. i am trying to pass in the argument 'd' representing delete. what the...
0
825
by: smahaboob | last post by:
Hi, All! My problem: It is necessary to print CR report directly to printer (without preview). For printing I am using Report object. Currently my report has 1 parameter. Can you explain me how...
4
2799
by: Bails | last post by:
Hi Im an absolute beginner in programming and am using VB.Net Express. To start my larning I decided to do a "Real World" app instead of "hello world" and am creating a Poker Countdown clock. ...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7386
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4918
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
295
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.