Review the implementation of getchar in cs50c Note that CHAR
Solution
1. On failure get_char raises an exception rather than NULL and produces a null pointer. So there should be exception handling to avoid the failure. But if we use char_max it return NULL when we get an error.
2. get_char() reads a single character input from the console but sscanf reads from the character string s. So from the given character string s we can read th character using sscanf function but not getchar().
3. Static allocation means allocating memory for variables when the program starts. This meory is fixed and cannot be changed during execution.
Static String: String means constant. Static string means string stored in one particular location.
When a declaration or allocation doesnt include any access specifier , the context in which the declaration takes place determines the default accessibility.
4. GetString() allocates memory for the string but it doesnt free that memory. We need to use free() function to free that memory. But if we forget this, then it may cause memory leaks.
So to avoid this problem the modern operating systems are designed such that when a program exists with memory leaks, the memory gets free by itself.
But it is a good practice to free the memory after our usage in the program.

