Click here to Skip to main content
15,890,282 members
Home / Discussions / C#
   

C#

 
GeneralRe: Please please please please ... Pin
IceWater426-Jun-09 21:42
IceWater426-Jun-09 21:42 
GeneralRe: Please please please please ... Pin
FocusedWolf7-Jun-09 9:09
FocusedWolf7-Jun-09 9:09 
GeneralRe: Please please please please ... Pin
David OBrien12-Oct-09 4:12
David OBrien12-Oct-09 4:12 
GeneralRe: Please please please please ... Pin
FocusedWolf5-Oct-09 11:45
FocusedWolf5-Oct-09 11:45 
Questionabout Array.Clone(), a shallow copy? Pin
Seraph_summer6-Jun-09 6:47
Seraph_summer6-Jun-09 6:47 
AnswerRe: about Array.Clone(), a shallow copy? Pin
Luc Pattyn6-Jun-09 6:57
sitebuilderLuc Pattyn6-Jun-09 6:57 
GeneralRe: about Array.Clone(), a shallow copy? Pin
Seraph_summer6-Jun-09 7:34
Seraph_summer6-Jun-09 7:34 
GeneralRe: about Array.Clone(), a shallow copy? Pin
Luc Pattyn6-Jun-09 8:11
sitebuilderLuc Pattyn6-Jun-09 8:11 
Hi,

a shallow copy copies value types and references; so all data is the same as the original, but no new objects got created except for the one class instance copied.

a deep copy copies value types and clones referenced objects; so all data is the same as the original, AND new objects got created every time there was a reference.

an array is a reference type.
when the array elements are value types (e.g. int[]) a shallow copya and a deep copy do the same: all values are copied in the new array;
when the array elements are objects (e.g. Control[]) a shallow copy just copies all references, a deep copy clones all referenced objects.

In another way: a shallow copy can be implemented as a memcpy(), copying bytes without knowing the types of the data copied; a deep copy needs to know whether the members are values or references.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: about Array.Clone(), a shallow copy? Pin
Seraph_summer6-Jun-09 8:27
Seraph_summer6-Jun-09 8:27 
AnswerRe: about Array.Clone(), a shallow copy? Pin
Dave Kreskowiak6-Jun-09 10:12
mveDave Kreskowiak6-Jun-09 10:12 
GeneralRe: about Array.Clone(), a shallow copy? Pin
Seraph_summer6-Jun-09 10:37
Seraph_summer6-Jun-09 10:37 
QuestionError in some client machines with Microsoft.mshtml Pin
ManojKumar196-Jun-09 6:41
ManojKumar196-Jun-09 6:41 
AnswerRe: Error in some client machines with Microsoft.mshtml Pin
Dave Kreskowiak6-Jun-09 10:08
mveDave Kreskowiak6-Jun-09 10:08 
GeneralRe: Error in some client machines with Microsoft.mshtml Pin
ManojKumar197-Jun-09 5:46
ManojKumar197-Jun-09 5:46 
GeneralRe: Error in some client machines with Microsoft.mshtml Pin
Dave Kreskowiak7-Jun-09 7:16
mveDave Kreskowiak7-Jun-09 7:16 
QuestionRegarding Notepad application Pin
Devi526-Jun-09 5:55
Devi526-Jun-09 5:55 
AnswerRe: Regarding Notepad application Pin
0x3c06-Jun-09 6:04
0x3c06-Jun-09 6:04 
AnswerRe: Regarding Notepad application Pin
Dave Kreskowiak6-Jun-09 10:05
mveDave Kreskowiak6-Jun-09 10:05 
GeneralRe: Regarding Notepad application Pin
EliottA8-Jun-09 11:36
EliottA8-Jun-09 11:36 
QuestionTry to get System.Net.Mail to work Pin
dptalt6-Jun-09 5:30
dptalt6-Jun-09 5:30 
AnswerRe: Try to get System.Net.Mail to work Pin
Dave Kreskowiak6-Jun-09 10:04
mveDave Kreskowiak6-Jun-09 10:04 
GeneralRe: Try to get System.Net.Mail to work Pin
dptalt8-Jun-09 3:40
dptalt8-Jun-09 3:40 
GeneralRe: Try to get System.Net.Mail to work Pin
Dave Kreskowiak8-Jun-09 14:07
mveDave Kreskowiak8-Jun-09 14:07 
AnswerRe: Try to get System.Net.Mail to work Pin
EliottA6-Jun-09 13:01
EliottA6-Jun-09 13:01 
QuestionC# application with mySQL Pin
treuveni6-Jun-09 5:25
treuveni6-Jun-09 5:25 

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.