tell me past so preparing...why we use this object and what purpose we use it
why and where do we use nameless object?
Collapse
X
-
Tags: None
-
Obviously a nameless object can't be referenced by us but it can be referenced by the compiler.
Suppose you have:
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.Code:string MyFunction(); string x = MyFunction();
Comment