Question: I'm studying Data Structures, and I'm not getting why stacks and queues need to be declared like:

```
struct stack *Stack;

```

(forget about the `struct` syntax)

I mean, why it is always declared as a pointer?

Answer: 
They are not always declared like that!

In general, declaring a variable as a pointer is useful for later allocating it dynamically. This can be due to a couple of reasons:

* The variable is too big for the program stack
* You want to return that variable from a function

In your case, let's think of two different implementations of stack:

```
struct stack
{
    void *stuff[10000];
    int size;
};

```

This is a terrible implementation, but assuming you have one like this, then you'd most probably not want to put it on the program stack.

Alternatively, if you have:

```
struct stack
{
    void **stuff;
    int size;
    int mem_size;
};

```

You dynamically change the size of `stuff` anyway, so there is absolutely no harm in declaring a variable of type `struct stack` on the program stack, i.e. like this:

```
struct stack stack;

```

Unless, you'd want to return it from a function. For example:

```
struct stack *make_stack(int initial_size)
{
    struct stack *s;

    s = malloc(sizeof(*s));
    if (s == NULL)
        goto exit_no_mem;

    if (initial_size == 0)
        initial_size = 1;
    s->stuff = malloc(initial_size * sizeof(*s->stuff));
    if (s->stuff == NULL)
        goto exit_no_stuff_mem;

    s->size = 0;
    s->mem_size = initial_size;

    return s;
exit_no_stuff_mem:
    free(s);
exit_no_mem:
    return NULL;
}

```

Personally, though, I would have declared the function like this:

```
int make_stack(struct stack *s, int initial_size);

```

and allocate the `struct stack` on the program stack.
No, they don't have to be declared as pointers.

One can as well allocate stacks and queues as global variables:

```
struct myHash { int key; int next_idx; int data[4]; } mainTable[65536];
struct myHash duplicates[65536*10];
int stack[16384];

```

myHash also includes a linked list for duplicate entries using indices.

But as stated in the comments, if one has to add more elements to the structures, that was initially planned, then pointers come handy.

An additional reason to declare structures as pointers is that it typically with pointers one can access both the complete structure as a whole, any individual element of the structure or some subset of the elements. That makes the syntax more versatile. Also when the structure is passed as a parameter to some external function, a pointer is inevitable.