top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

which is good for debugging Static or Global in C? Please explain with Reason.

+2 votes
376 views
which is good for debugging Static or Global in C? Please explain with Reason.
posted Oct 2, 2013 by Giri Prasad

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Good question as I never thought that variable type can have any impact on the debugging.

1 Answer

+3 votes

Debugging has no relation with static or global if you are comfortable with gdb. Having said that static has a file scope so sometimes same variable can exist in multiple files and can create some confusion with large project debugging.

But for programming practice point of view global should be avoided. Static is fine (loosely)

answer Oct 2, 2013 by Salil Agrawal
...