PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs223] Checking if Deque does not exist
Date: Sunday, 05 Apr 2020, 09:28:35


    > Message Posted By: Unknown
    >
    > I have read two previous newsgroup posts about this but I am still unsure
    > of how to handle the case where a Deque has not been created but we are
    > trying to perform operations on it.
    >
    > I tried checking if *d == NULL, but this did not work (still got a
    > segmentation fault). I also tried checking if the head and tail members of
    > the deque struct == NULL but this did not work either.
    >
    > I put a print statement at the top of isEmptyD() to see if it was even
    > entering the function before producing the segmentation fault, and it was.
    > However, I'm really not sure what kind of if statement to put in there to
    > check if *d (the argument) is a valid deque or not. Any guidance would be
    > great. Thank you.

Hint: What is the value of the Deque variable after you
destroy that Deque?  Hwk4/testDeque.c initializes all
Deque variables to that value.

--Stan-
PREV INDEX NEXT