Why can't the static and register storage classes be used together?
问题 When defining a variable in the following manner: static register int a1 = 0; we get the error: error: multiple storage classes in declaration specifiers Is there any fundamental reason for this error? Why can't a variable be both stored in a register, and also be initialized only at start up/first call? It is possible to attach the register storage class to a global variable. <- edit: not true 回答1: If a compiler implemented what you wanted faithfully then it would tie up a CPU register for