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 ...
kzidane's user avatar
  • 17.6k
1 vote
Accepted

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 ...
Cliff B's user avatar
  • 68.1k
1 vote
Accepted

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 ...
Blauelf's user avatar
  • 20.9k
1 vote
Accepted

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 ...
MARS's user avatar
  • 5,159

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