Click here to Skip to main content
15,895,836 members
Home / Discussions / C#
   

C#

 
AnswerRe: if someone could help me identify the problem please. Pin
Nagy Vilmos23-Jul-09 7:27
professionalNagy Vilmos23-Jul-09 7:27 
GeneralRe: if someone could help me identify the problem please. Pin
PIEBALDconsult23-Jul-09 7:30
mvePIEBALDconsult23-Jul-09 7:30 
GeneralRe: if someone could help me identify the problem please. Pin
Nagy Vilmos23-Jul-09 7:46
professionalNagy Vilmos23-Jul-09 7:46 
GeneralRe: if someone could help me identify the problem please. Pin
PIEBALDconsult23-Jul-09 7:48
mvePIEBALDconsult23-Jul-09 7:48 
GeneralRe: if someone could help me identify the problem please. Pin
LetMeFinclOut23-Jul-09 12:15
LetMeFinclOut23-Jul-09 12:15 
GeneralRe: if someone could help me identify the problem please. [modified] Pin
Luc Pattyn23-Jul-09 7:33
sitebuilderLuc Pattyn23-Jul-09 7:33 
GeneralRe: if someone could help me identify the problem please. Pin
Nagy Vilmos23-Jul-09 7:46
professionalNagy Vilmos23-Jul-09 7:46 
GeneralRe: if someone could help me identify the problem please. Pin
Curtis Schlak.23-Jul-09 18:02
Curtis Schlak.23-Jul-09 18:02 
Depending on your point of view, fortunately or unfortunately, not all strings in the CLI are interned. Essentially, any string loaded with the MSIL ldstr command is interned, and anything programatically interned is interned. For example, if we run the following code
string interned1 = "hello";
string interned2 = "hello";
string notinterned = new String("hello".ToCharArray());
string interned4 = string.Intern(notinterned);
Console.WriteLine(RuntimeHelpers.GetHashCode(interned1));
Console.WriteLine(RuntimeHelpers.GetHashCode(interned2));
Console.WriteLine(RuntimeHelpers.GetHashCode(notinterned));
Console.WriteLine(RuntimeHelpers.GetHashCode(interned4));
then we get the corresponding output
58225482
58225482
54267293
58225482
As you can see from the output, the interned strings all show the same "memory location" while the programatically constructed string shows a different location.

(.NET 3.5) In terms of string equality, though, the override of operator== calls the public static string.Equals(string, string) method which calls a private static method to determine equality. string.Equals(string) calls the private static method directly.

"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty

GeneralRe: if someone could help me identify the problem please. Pin
Adam R Harris23-Jul-09 7:50
Adam R Harris23-Jul-09 7:50 
GeneralRe: if someone could help me identify the problem please. Pin
Luc Pattyn3-Sep-09 5:17
sitebuilderLuc Pattyn3-Sep-09 5:17 
AnswerRe: if someone could help me identify the problem please. Pin
PIEBALDconsult23-Jul-09 7:49
mvePIEBALDconsult23-Jul-09 7:49 
AnswerRe: if someone could help me identify the problem please. Pin
DinoRondelly23-Jul-09 8:32
DinoRondelly23-Jul-09 8:32 
GeneralRe: if someone could help me identify the problem please. Pin
PIEBALDconsult23-Jul-09 12:45
mvePIEBALDconsult23-Jul-09 12:45 
QuestionHow to inject code to assembly (inject new class)? Pin
hdv21223-Jul-09 7:14
hdv21223-Jul-09 7:14 
QuestionPass data between two child forms Pin
Saamir23-Jul-09 6:56
Saamir23-Jul-09 6:56 
AnswerRe: Pass data between two child forms Pin
musefan23-Jul-09 7:00
musefan23-Jul-09 7:00 
GeneralRe: Pass data between two child forms Pin
Saamir23-Jul-09 7:14
Saamir23-Jul-09 7:14 
GeneralRe: Pass data between two child forms Pin
Saamir23-Jul-09 7:25
Saamir23-Jul-09 7:25 
AnswerRe: Pass data between two child forms Pin
Giorgi Dalakishvili23-Jul-09 7:45
mentorGiorgi Dalakishvili23-Jul-09 7:45 
QuestionProblem with overriding minimization of Form with Wndproc Pin
ThomasManz23-Jul-09 6:16
ThomasManz23-Jul-09 6:16 
AnswerRe: Problem with overriding minimization of Form with Wndproc Pin
musefan23-Jul-09 6:57
musefan23-Jul-09 6:57 
GeneralRe: Problem with overriding minimization of Form with Wndproc Pin
ThomasManz29-Jul-09 10:09
ThomasManz29-Jul-09 10:09 
QuestionThrowing exception while Copying a file from a system to a shared location in another system Pin
cdewzrd23-Jul-09 4:35
cdewzrd23-Jul-09 4:35 
AnswerRe: Throwing exception while Copying a file from a system to a shared location in another system Pin
DoctorMick23-Jul-09 5:19
DoctorMick23-Jul-09 5:19 
QuestionButtons look different with DirectX Pin
Jordanwb23-Jul-09 4:30
Jordanwb23-Jul-09 4:30 

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.