470,855 Members | 1,172 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

reference variable...and normal.....variable.....

can any budy help me out.......

plz.....tell me the diffrence b/w reference variable...and
normal.....variable.....
in context of prons and cons....
for example

class base
{
int a,b,c,d;
...........
...........
...........
...........
};
void main()
{
base obj,&ref=*(new base);
cout<<sizeof(obj);// outout 8
cout<<sizeof(ref);// output 8
}
if size of both the variable is same......and even accessing method is
same.......then...is there any benifit......to use refrence
variable.....instead of normal.......if...any plz xplain

kkaushik

Apr 25 '06 #1
2 1643
dost wrote:
can any budy help me out.......

plz.....tell me the diffrence b/w reference variable...and
normal.....variable.....
in context of prons and cons....
for example

class base
{
int a,b,c,d;
...........
...........
...........
...........
};
void main()
{
base obj,&ref=*(new base);
cout<<sizeof(obj);// outout 8
cout<<sizeof(ref);// output 8
}
if size of both the variable is same......and even accessing method is
same.......then...is there any benifit......to use refrence
variable.....instead of normal.......if...any plz xplain

kkaushik


See the FAQ:

http://www.parashift.com/c++-faq-lite/references.html

Cheers! --M

Apr 25 '06 #2
mlimber wrote:
dost wrote:
can any budy help me out.......

plz.....tell me the diffrence b/w reference variable...and
normal.....variable.....
in context of prons and cons....
for example

class base
{
int a,b,c,d;
...........
...........
...........
...........
};
void main()
{
base obj,&ref=*(new base);
cout<<sizeof(obj);// outout 8
cout<<sizeof(ref);// output 8
}
if size of both the variable is same......and even accessing method is
same.......then...is there any benifit......to use refrence
variable.....instead of normal.......if...any plz xplain

kkaushik


See the FAQ:

http://www.parashift.com/c++-faq-lite/references.html

Cheers! --M


Is there a section in the FAQ on the prons [sic] and cons of minimally
coherent English?
Apr 25 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Sreenivas | last post: by
7 posts views Thread by Howard | last post: by
7 posts views Thread by Pekus Cons. e Desenvolvimento | last post: by
6 posts views Thread by Rob Nicholson | last post: by
51 posts views Thread by Kuku | last post: by
22 posts views Thread by tshad | last post: by
27 posts views Thread by David W | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.