Recently, I ran into an interesting job interview question in C++ which I want to share. Lets take a look at the following code:
// Option A.
char str1[] = “example”;
str1[1] = ‘a’;
// Option B.
char* str2 = “example”;
str2[1] = ‘a’;
What would happen if we compile and run this code ?
Continue Reading...
Yesterday I played around with WPF resources and stumbled on a very strange behavior. It seems that the order of the elements in the resources have some importance as to how the application handles them. A few code examples are attached
Continue Reading...
Lately I took part in several code reviews and I noticed that whenever people need to extract the month name from the datetime object many different solutions are presented. Some of the solutions were not very successful, so I decided to shed some light on this issue through an example.
These are the most common (and [...]
Continue Reading...