Pensu
Member • Aug 6, 2011
Is declaring global variables a good practice????
Hey ppl,
This is a good question asked to my friend in his interview. They asked him to make a simple stack program. He made it using array and declaring it globally so each function could access it easily. But they told him, its not good to use global variables in program. And according to him this might be the reason he didnt get selected. Can anyone throw some more light on this????
This is a good question asked to my friend in his interview. They asked him to make a simple stack program. He made it using array and declaring it globally so each function could access it easily. But they told him, its not good to use global variables in program. And according to him this might be the reason he didnt get selected. Can anyone throw some more light on this????