473,815 Members | 2,537 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Assigning reference to variables..

hi, when I do:
someclass &someobject = someotherobject ;

it asigns the reference of someotherobject to the variable 'someobject' that
you just declared. SO that basically
someobject and someotherobject are really the same variable with two names.

but if I do:

someclass someobject;
&someobject = someotherobject ;

it no longer works D:
does anyone know how to get it to work in the second case?

--
Jul 19 '05
17 4710
"Howard" <al*****@hotmai l.com> wrote...

"Attila Feher" <at**********@l mf.ericsson.se> wrote in message
news:bl******** **@newstree.wis e.edt.ericsson. se...
Gary Labowitz wrote:
The only thing worse than teaching C++ is working next to a guy
programming it with void main( ) and arguing all the time.


The human stupidity is the only endless resource on Earth.

--
Attila aka WW


At least we can take heart in the fact that only about half the people on
earth are of below average intelligence!

(think about it...)


It depends on how you calculate the average intelligence and on the spread
of intelligence among people.

Take a set of numbers 1 1 1 1 1 1 2 2 2 2 2 2 8 100. The
"mathematic al expectation" (the sum divided by the count) is going to be
126/14, or 9, and 13 out of 14 numbers (92.9%) would be below that average.

Think about it...

Victor

P.S. Wouldn't it be nice to be the 100 in that list?
Jul 19 '05 #11

"Victor Bazarov" <v.********@att Abi.com> wrote in message
news:hHXeb.6671 72$uu5.108805@s ccrnsc04...
"Howard" <al*****@hotmai l.com> wrote...

At least we can take heart in the fact that only about half the people on earth are of below average intelligence!

(think about it...)


It depends on how you calculate the average intelligence and on the spread
of intelligence among people.


Well, just like on TV, I define "average" in the way that suits my point
best! In this case, "median" instead of "mean". :-)

-Howard
Jul 19 '05 #12
In article <bl********@dis patch.concentri c.net>, al*****@hotmail .com
says...

[ ... ]
At least we can take heart in the fact that only about half the people on
earth are of below average intelligence!

(think about it...)


That would only be true if the "average" you use is the median instead
of the (much more common) arithmetic mean. A mean can be heavily
affected by a small group at an extreme (a typical example of this is
average income -- a few extremely rich people raise mean _well_ above
the median).

--
Later,
Jerry.

The universe is a figment of its own imagination.
Jul 19 '05 #13
WW
jeffc wrote:
"Howard" <al*****@hotmai l.com> wrote in message
news:bl******** @dispatch.conce ntric.net...

At least we can take heart in the fact that only about half the
people on earth are of below average intelligence!

(think about it...)


Depends on how you define average. When you factor intelligence like
mine into the mean, probably about 99% of the people are of below
average intelligence.


Yep. That 99% is also called "the modest people". ;-)

--
WW aka Attila
Jul 19 '05 #14
WW
Howard wrote:
"Victor Bazarov" <v.********@att Abi.com> wrote in message
news:hHXeb.6671 72$uu5.108805@s ccrnsc04...
"Howard" <al*****@hotmai l.com> wrote...

> >

At least we can take heart in the fact that only about half the
people on earth are of below average intelligence!

(think about it...)


It depends on how you calculate the average intelligence and on the
spread of intelligence among people.


Well, just like on TV, I define "average" in the way that suits my
point best! In this case, "median" instead of "mean". :-)


That's mean. :-)

--
WW aka Attila
Jul 19 '05 #15
WW
Howard wrote:
"Attila Feher" <at**********@l mf.ericsson.se> wrote in message
news:bl******** **@newstree.wis e.edt.ericsson. se...
Gary Labowitz wrote:
The only thing worse than teaching C++ is working next to a guy
programming it with void main( ) and arguing all the time.


The human stupidity is the only endless resource on Earth.


At least we can take heart in the fact that only about half the
people on earth are of below average intelligence!


IMO the stupidity I talk about and intelligence they measure has nothing to
do with each other. IQ does not measure quality or method of the solution
one gives to a problem. It only finds out if that problem was solved.
People using void main in an environment not decent enough to warn about it
have solved the problem. They might be shortsighted and not give a damn
about the information that void main is not legal. And that might even help
them while making an IQ test. They never get distracted by anything.
Morals or consequences are beyond them. Look at our late troll.

--
WW aka Attila
Jul 19 '05 #16
Gary Labowitz wrote:
"Kevin Goodsell" <us************ *********@never box.com> wrote in message
news:Ac******** **********@news read3.news.pas. earthlink.net.. .

That's not a very good way to learn C++. Frankly, most C++ teachers
don't know the language well enough to be teaching it (but they usually
believe they do). A good book is about the best way.

Ahem. I teach C++ AND I know it well enough to be teaching it.

<snip>

Then I wasn't talking about you. ;)

Seriously, I think it's safe to say that most teachers' C++ lecture
notes are riddled with errors, and not a good way to learn the language.
Maybe I'm wrong (about C++ teachers in general), but I don't think I am,
based on how many C++ programmers I've come across who know a language
bearing some similarities to C++, but being fundamentally a completely
different language. These same programmers are often the ones who are
quite certain that C++ is what they say it is, and will hold onto this
belief even in the face of overwhelming evidence to the contrary.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #17
WW
Kevin Goodsell wrote:
[SNIP]
Seriously, I think it's safe to say that most teachers' C++ lecture
notes are riddled with errors, and not a good way to learn the
language. Maybe I'm wrong (about C++ teachers in general), but I
don't think I am, based on how many C++ programmers I've come across
who know a language bearing some similarities to C++, but being
fundamentally a completely different language. These same programmers
are often the ones who are quite certain that C++ is what they say it
is, and will hold onto this belief even in the face of overwhelming
evidence to the contrary.


In a Hungarian University they had the following name for a program:
cprog01.cpp. The program was supposed to be a C program. The first header
it loaded was conio.h. It was full of variable declarations in the middle
of compound statements. When I have made the students to point out all the
errors in the code the teacher started to rant and accused them to attack
him, because he was a refugee... The Brave New World...

--
WW aka Attila
Jul 19 '05 #18

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

Similar topics

4
4960
by: cppaddict | last post by:
I understand that there are a couple differences between reference variables and pointer: 1) reference variables *must* be initialized. 2) You cannot change what a reference variable refers to. My question is: In what situations is it better to use a reference variable over a pointer? Also, are there other differences besides the ones I listed above?
12
1904
by: ypjofficial | last post by:
Hello All, I need to return a vector from a function.The vector is of int and it can contain as many as 1000 elements.Earlier I was doing //function definition vector<intretIntVector() { vector<intvecInt; /* //Populate the vector with int values.
5
1630
by: Chaos | last post by:
Is It possible to have reference variables like in PHP ex. <?php $x = 1; $y =& $x; $y += 1;
16
2393
by: jryden | last post by:
I can do this: struct myInt { int i; }; void func1(myInt &i = myInt()); but not this:
3
1523
by: v4vijayakumar | last post by:
While we can do whatever we want to do with the member variables, with the member references, why member references are not common? Note: This is not homework question. :)
1
1301
by: localhost1 | last post by:
i want to make a loop in javascript code to assign the php variables in the javascript variables. can it be done? how?
3
1411
by: Rahul | last post by:
Hi Everyone, I just tried the following code, in response to some post on reference member variable and i'm not able to understand what exactly is happening over here, int main() { int a=5,b=6;
9
2340
by: sulekhasweety | last post by:
dear all, can anyone explain the differences between pointer variable and reference variables ?
0
9736
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10672
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10145
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7687
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6897
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5710
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3888
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3030
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.