What is the minimum size (in bytes) of string data type in c#?
Give its compatible data type in .NET Framework.
Answers were Sorted based on User's Feedback
Answer / dileep
A string type takes 4 bytes (A string is a referenc type)
Bcoz either it references a null value or a non-null value
since it is a reference type which holds the address of a
memory location it occupies the size of an integer (which
is 4 bytes in c#).
Is This Answer Correct ? | 7 Yes | 0 No |
Answer / paresh nawale
dileep is right.
as string is refrence type it need 4 bytes to hold memeory
address.
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / ganesh
sorry harikrishna. ur answer is wrong.
by default the size of a string is 0 bytes.we can have a
null string in c#.
Is This Answer Correct ? | 2 Yes | 5 No |
How big is int16?
What is a string? What are the properties of a string class?
difference between keyword internal and protected?
Could you explain the difference between func vs action vs predicate?
Give examples for reference types?
How do you remove white spaces from a string?
What is difference between class and interface in c#?
What is delegate in c#?
So let's say I have an application that uses myapp.dll assembly, version 1.0.0.0. There is a security bug in that assembly, and I publish the patch, issuing it under name myapp.dll 1.1.0.0. How do I tell the client applications that are already installed to start using this new myapp.dll?
How does dll hell solve in .net?
Is std :: string null terminated?
Using system; class main { public static void Main() { int a = 1; for (int i = 0; i < 10; i++) { int j = a * 5; Console.WriteLine(a + "*5=" + j); a++; } Console.ReadLine(); } }