Does anybody review challenge questions?
I have found too many wrong questions related to C programming. I will mention the ones that blew my mind. Example: char str1 = "solo"; char str2 = "learn"; strcpy( str1, str2); strcmp(str1, str2); str1 can store 4 bytes and str2 5 bytes, excluding the terminating null byte. strcpy() executes without error because str1 can store all 5 bytes of "learn" but then str1 is not a valid string as it is not null terminated. A similar error in another question included strcat() which was used to append str2 to str1. There is no need to mention again there is not enough space. The final problem was in printf() calls like the following: printf("%d %d %d\n", a++, --a, a); where variable 'a' is an int. The order in which the calculation of the parameters is conducted is implementation defined. For a = 5 and gcc as the system compiler, the output is: "4 5 5". Such operations should be done before calling printf. Good C programmers may lose challenges due to so many mistakes.