Why some people do:
char baa(int x) {
static char foo[] = \" .. \";
return foo[x ..];
}
instead of:
char baa(int x) {
Yes it makes difference , if u have declared a variable as static :
Firstly, the memory will be allocated in either bss or data segment instead of stack.
Secondly, it will be initialized for once only , not every time unlike other variables of function, which will surely create difference.
Thirdly, it retains it's value b/w function calls.So depending on the situations you should use it.