Questions tagged [global]
The global tag has no usage guidance.
6
questions
1
vote
1answer
31 views
Global Variable vs Local variables?
I'm trying to write a function that will be called in main(int argc, string argv[]) for pset 2: plurality.
Inside the function, I want a for loop. I've written this:
bool vote(string name)
{
...
0
votes
1answer
123 views
Pset5 with linked list: head node creation
I am having some headaches about pset5.
Before tackling hashtables and tries, I have been trying to solve the problem with a single linked list to make it simpler. To do this I have defined a couple ...
0
votes
1answer
113 views
Global Pointer Value Changing to 0x0
So I'm doing pset5, speller.
I'm storing the words in the dictionary in a trie, whose root is a pointer to a node, called root.
root is a global variable first initialized to NULL.
root is first used ...
0
votes
1answer
152 views
PSET5 speller, what am I doing wrong passing my dictionary to check?
I have been spending loads of time staring at my code for loading a dictionary and checking for misspelled words. Te programme keeps telling me that all words are misspelled which leads me to believe ...
0
votes
1answer
350 views
pointer for function using global variable
I understand why passing value in a function does not work as main function will not have access to changed value (change takes place in the stack frame of called function
However if I declare ...
0
votes
1answer
24 views
where to initialize the variable that keeps track of the blank space
I am working on "Move" of exercise Fifteen in PSET3 of CS50.
I am unsure about how to keep track of the blank space. I have tried to add the row and column number of the initial blank space as a ...