Click here to Skip to main content
15,919,245 members
Home / Discussions / C#
   

C#

 
GeneralRe: writing combo box items Pin
Martin#16-Jul-07 20:04
Martin#16-Jul-07 20:04 
GeneralRe: writing combo box items Pin
Vikram A Punathambekar16-Jul-07 21:41
Vikram A Punathambekar16-Jul-07 21:41 
QuestionDrawing Digital Signal Pin
satsumatable16-Jul-07 18:52
satsumatable16-Jul-07 18:52 
AnswerRe: Drawing Digital Signal Pin
ekynox16-Jul-07 22:41
ekynox16-Jul-07 22:41 
AnswerRe: Drawing Digital Signal Pin
Bert delaVega17-Jul-07 6:24
Bert delaVega17-Jul-07 6:24 
QuestionCopying objects by value Pin
jozsurf16-Jul-07 17:59
jozsurf16-Jul-07 17:59 
AnswerRe: Copying objects by value Pin
originSH16-Jul-07 22:09
originSH16-Jul-07 22:09 
AnswerRe: Copying objects by value Pin
Luc Pattyn16-Jul-07 22:47
sitebuilderLuc Pattyn16-Jul-07 22:47 
Hi,

if you have one instance of a class, and you suddenly need a second instance that initially
has the same value, you can go either way:

- instantiate the class with what you call a "copy constructor", i.e. a regular constructor
that takes its own type as an input argument and copies values from it (shallow copy);

- or create an instance method that creates a "clone" (=again a shallow copy), by first
instantiating a new instance, then copying values into it. Several CLI classes offer
such a Clone method, e.g. Array and ArrayList

I havent encountered a Copy method yet, one that takes two objects and copies values
from one into the other (DirectX has some Copy methods, but IMO they should have been called
Clone instead).

The cost for both approaches would be the same; they both create a new object and
initialize it. Nowhere in this an object gets deallocated.

Hope this helps.

Smile | :)


GeneralRe: Copying objects by value Pin
jozsurf16-Jul-07 23:42
jozsurf16-Jul-07 23:42 
GeneralRe: Copying objects by value Pin
Luc Pattyn17-Jul-07 0:20
sitebuilderLuc Pattyn17-Jul-07 0:20 
GeneralRe: Copying objects by value Pin
jozsurf17-Jul-07 15:06
jozsurf17-Jul-07 15:06 
GeneralRe: Copying objects by value Pin
Luc Pattyn17-Jul-07 16:45
sitebuilderLuc Pattyn17-Jul-07 16:45 
GeneralRe: Copying objects by value Pin
jozsurf17-Jul-07 16:59
jozsurf17-Jul-07 16:59 
GeneralRe: Copying objects by value [modified] Pin
Luc Pattyn17-Jul-07 17:15
sitebuilderLuc Pattyn17-Jul-07 17:15 
GeneralRe: Copying objects by value Pin
jozsurf17-Jul-07 18:07
jozsurf17-Jul-07 18:07 
GeneralRe: Copying objects by value Pin
Luc Pattyn22-Jul-07 12:00
sitebuilderLuc Pattyn22-Jul-07 12:00 
QuestionHow to set and get Windows Application's Version? Pin
Khoramdin16-Jul-07 17:21
Khoramdin16-Jul-07 17:21 
AnswerRe: How to set and get Windows Application's Version? Pin
Vikram A Punathambekar16-Jul-07 17:40
Vikram A Punathambekar16-Jul-07 17:40 
QuestionRe: How to set and get Windows Application's Version? Pin
Khoramdin16-Jul-07 19:20
Khoramdin16-Jul-07 19:20 
AnswerRe: How to set and get Windows Application's Version? Pin
Vikram A Punathambekar16-Jul-07 21:05
Vikram A Punathambekar16-Jul-07 21:05 
AnswerRe: How to set and get Windows Application's Version? Pin
originSH16-Jul-07 22:14
originSH16-Jul-07 22:14 
AnswerRe: How to set and get Windows Application's Version? Pin
ekynox17-Jul-07 13:33
ekynox17-Jul-07 13:33 
QuestionDataGrid date AND time Column[modified] Pin
swjam16-Jul-07 14:24
swjam16-Jul-07 14:24 
AnswerRe: DataGrid date AND time Column[modified] Pin
Michael Sync16-Jul-07 17:39
Michael Sync16-Jul-07 17:39 
GeneralRe: DataGrid date AND time Column[modified] Pin
swjam16-Jul-07 20:59
swjam16-Jul-07 20:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.