top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

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

+2 votes
83 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
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...