Hot answers tagged

2 votes

Global Variable vs Local variables?

candidate_count is not declared in main. It's a global variable (declared outside of main) on line 20 in the distribution file plurality.c at the time of this writing. The definition of main starts ...
  • 17.5k
1 vote

pset5 speller Hash table not appearing in the debug50 stack/heap

Look very carefully at all of the areas on the right side of the screen. Did you notice that the area that shows the vars and their content is called local variables? It isn't that the vars you ...
  • 66.2k
1 vote

Pset5 with linked list: head node creation

An empty linked list consists only of a NULL pointer, no node. There is no dedicated "head" node, just a "head" pointer pointing to the first node (and if there's none, it's NULL). So you could just ...
  • 20.8k
1 vote

pointer for function using global variable

Interesting question. The answer is that a global variable does not work in your program. The compiler warning is really telling you that the variable a, in main, is different from the variable a in ...
  • 5,201

Only top scored, non community-wiki answers of a minimum length are eligible