R
Richard
Hi,
I'm wondering if anyone can answer these questions for me (or point me
to somewhere maybe on msdn which covers this if it exists)
Take the following code:
switch (aValue)
{
case "Something":
case "SomethingElse"
}
In this code, would there be the equivalent of two string objects
created in memory? Or does C# do something clever here?
With the same example above, does C# have a symbol table in the
compiled output where these get stored? I know its considered good
practise if say the string "Something" is used frequently to put it
into a constant, but I recall back in VB5 days that it was actually
faster to put it in constants as well. I wondered if the same applies
for C#.
Many thanks,
Richard
I'm wondering if anyone can answer these questions for me (or point me
to somewhere maybe on msdn which covers this if it exists)
Take the following code:
switch (aValue)
{
case "Something":
case "SomethingElse"
}
In this code, would there be the equivalent of two string objects
created in memory? Or does C# do something clever here?
With the same example above, does C# have a symbol table in the
compiled output where these get stored? I know its considered good
practise if say the string "Something" is used frequently to put it
into a constant, but I recall back in VB5 days that it was actually
faster to put it in constants as well. I wondered if the same applies
for C#.
Many thanks,
Richard