I am just learning C# and looking deeper into data types.
Why isn't a bool data type 1 bit in size?
It seems it can only hold one of two values (true or false), so wouldn't that only take up 1 bit …
Example (note the case):
string s = "Hello world!";
String s = "Hello world!";
What are the guidelines for the use of each? And what are the differences?
I've seen many people use the following code:
Type t = typeof(obj1);
if (t == typeof(int))
// Some code here
But I know you could also do this:
if (obj1.GetType() == typeof(int))
// Some code here
Or this:
if (obj1 is …