Click here to Skip to main content
13,398,090 members (38,582 online)

.NET Framework

 
QuestionDisappearing FormClosing/FormClosed event Pin
Bernhard Hiller14-Oct-12 23:39
memberBernhard Hiller14-Oct-12 23:39 
AnswerRe: Disappearing FormClosing/FormClosed event Pin
Eddy Vluggen15-Oct-12 1:44
memberEddy Vluggen15-Oct-12 1:44 
Question.Net Securing Connection String Clarification Pin
Member 838957110-Oct-12 11:39
memberMember 838957110-Oct-12 11:39 
AnswerRe: .Net Securing Connection String Clarification Pin
Richard Andrew x6410-Oct-12 13:03
memberRichard Andrew x6410-Oct-12 13:03 
GeneralRe: .Net Securing Connection String Clarification Pin
Member 838957110-Oct-12 15:29
memberMember 838957110-Oct-12 15:29 
GeneralRe: .Net Securing Connection String Clarification Pin
Mathlab21-Nov-12 6:33
memberMathlab21-Nov-12 6:33 
AnswerRe: .Net Securing Connection String Clarification Pin
jschell11-Oct-12 9:53
memberjschell11-Oct-12 9:53 
QuestionArray of Double - Shallow vs. Deep Cloning? Pin
Mike-MadBadger5-Oct-12 8:01
memberMike-MadBadger5-Oct-12 8:01 
So I'm quite comfortable with shallow and deep cloning for value and reference types but want to check how this plays out for an array of a value type.

I have a 2D array of double and since the array contains value types I think the Array.Clone method (whilst only guaranteeing shallow copies) will give a deep copy in this instance. Am I right?
Private _matrix as double(,)

Public Function CopyToArray() as Double(,)
    Return Me._matrix.Clone()
End Fucntion

Public Function Copy() As Matrix
    Return New Matrix(Me.CopyToArray())
End Function

Public Sub New(ByVal array As Double(,))
    Me._matrix = array
End Sub

The constructor assumes that the user wants to assign the 2D array of double(,) they have already created to the new matrix instance and hence doesn't use Array.Clone (and since the array is a class and is therefore a reference type, ByVal essentially has no meaning in this context). Did I get that bit right?

Thanks,
Mike
AnswerRe: Array of Double - Shallow vs. Deep Cloning? Pin
Eddy Vluggen5-Oct-12 13:25
memberEddy Vluggen5-Oct-12 13:25 
GeneralRe: Array of Double - Shallow vs. Deep Cloning? Pin
Mike-MadBadger7-Oct-12 10:56
memberMike-MadBadger7-Oct-12 10:56 
AnswerRe: Array of Double - Shallow vs. Deep Cloning? Pin
Eddy Vluggen8-Oct-12 1:39
memberEddy Vluggen8-Oct-12 1:39 
GeneralRe: Array of Double - Shallow vs. Deep Cloning? Pin
Mike-MadBadger10-Oct-12 0:04
memberMike-MadBadger10-Oct-12 0:04 
GeneralRe: Array of Double - Shallow vs. Deep Cloning? Pin
Eddy Vluggen10-Oct-12 2:22
memberEddy Vluggen10-Oct-12 2:22 
GeneralOT Pin
Mike-MadBadger10-Oct-12 3:23
memberMike-MadBadger10-Oct-12 3:23 
GeneralRe: OT Pin
Eddy Vluggen10-Oct-12 10:00
memberEddy Vluggen10-Oct-12 10:00 
GeneralRe: Array of Double - Shallow vs. Deep Cloning? Pin
dojohansen10-Oct-12 6:36
memberdojohansen10-Oct-12 6:36 
GeneralRe: Array of Double - Shallow vs. Deep Cloning? Pin
Eddy Vluggen10-Oct-12 10:09
memberEddy Vluggen10-Oct-12 10:09 
QuestionSMS forwarding through GSM modem Pin
Member 94607155-Oct-12 3:57
memberMember 94607155-Oct-12 3:57 
QuestionHow to force rendering to generate an ID? Pin
AtALossHere5-Oct-12 2:13
memberAtALossHere5-Oct-12 2:13 
AnswerRe: How to force rendering to generate an ID? Pin
Sandeep Mewara5-Oct-12 3:24
mvpSandeep Mewara5-Oct-12 3:24 
GeneralRe: How to force rendering to generate an ID? Pin
AtALossHere5-Oct-12 4:26
memberAtALossHere5-Oct-12 4:26 
GeneralRe: How to force rendering to generate an ID? Pin
Sandeep Mewara5-Oct-12 4:30
mvpSandeep Mewara5-Oct-12 4:30 
GeneralRe: How to force rendering to generate an ID? Pin
AtALossHere5-Oct-12 5:51
memberAtALossHere5-Oct-12 5:51 
AnswerRe: How to force rendering to generate an ID? Pin
AtALossHere5-Oct-12 5:58
memberAtALossHere5-Oct-12 5:58 
QuestionCustom Class Exception Management / Setup Pin
Mike-MadBadger4-Oct-12 2:40
memberMike-MadBadger4-Oct-12 2:40 

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.


Advertise | Privacy |
Web02 | 2.8.180216.1 | Last Updated 17 Feb 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid