473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

why and where do we use nameless object?

tell me past so preparing...why we use this object and what purpose we use it
Mar 24 '13 #1
2 2921
weaknessforcats
9,208 Expert Mod 8TB
Obviously a nameless object can't be referenced by us but it can be referenced by the compiler.

Suppose you have:

Expand|Select|Wrap|Line Numbers
  1. string MyFunction();
  2.  
  3. string x = MyFunction();
Here MyFunction returns a string object that you assign to string x. That returned string object is a nameless object. It only exists to get from the called function back to your string x. Then it disappears.
Mar 24 '13 #2
whodgson
542 512MB
When you reserve memory using 'new' for say an object,the object is essentially nameless however its address is held by the pointer to which it is assigned...I think.
Mar 28 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Tim Hoffman | last post by:
Hi I have been using object crafts csv module for quite a few projects, mainly because I found the csv in python in it's current incarnation is funtionally inferior to object crafts. The object...
6
by: Charles Law | last post by:
As a matter of practice, where would people put the following elements of object creation/initialisation: Create shared member objects Initialise shared member objects Create non-shared member...
4
by: Lee Gillie | last post by:
What I am hoping to do is make a constructor for a derived class that can accept an instance of the base class. Maybe this just is not possible? I am working with the new SSLStream in the 2005...
12
by: Andrew Poulos | last post by:
With the following code I can't understand why this.num keeps incrementing each time I create a new instance of Foo. For each instance I'm expecting this.num to alert as 1 but keeps incrementing. ...
12
by: Belebele | last post by:
Suppose that a class A depends on class B because an object of class B is passed into A's constructor. See below: class B { ... }; class A { public: A(B const& b); ... };
9
by: Joseph Turian | last post by:
Consider this code snippet which doesn't compile: struct DebugOptions { }; class Debug { public: Debug(const DebugOptions options) { _options = options; } private:
1
by: twowaystosayiloveyou | last post by:
I am using VS2005 to build an ASP.net2.0 web site. After buidling from VS2005, where is the generated object files and temporary files? I cannot find anywhere. --?
1
by: John L. | last post by:
How do I invoke the scroll() method of a window object for a scrollable IFRAME element in an HTML document? I am using IE 7.0, and I thought the following would work: ...
6
by: Rajesh | last post by:
I read Global Object's constructor will be called before main() function; In which situation it can be really helpful? Is it good practice use Global object and its constructor ? Thanks,...
1
by: nikhil kumar gupta | last post by:
what is nameless object
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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
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,...
0
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...

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.