Explain the different use cases for the static keyword in C. How does it affect linkage and memory allocation?