Function declaration inside function?

I came across the following code and, being a C newbie, came here for your help.

This function is performed by nesting them in the queue.

Bool queuePut(Queue *q, char c) 
{
    void beep();

    if (queueFull(q)) 
    {
        beep();
        return false;
    }

    //do stuff

    return true;
}

So, I get a weird error with gcc on void beep (). Can someone please explain to me what it is by declaring a function inside a function. Or is this empty beep () just out of place? I was given this code, and there is always the possibility that this is not correct.

Edit: The error I am getting is:

c:/djgpp/tmp/src/ccrjtmBh.o:queue.c:(.text+0x50): undefined reference to
    '_beep'
collect 2: ld returned 1 exit status.

Is this a binding error?

+5
source share
3 answers

Most likely you have a binding error, because:

void beep();

, . C . , , .

+4

, . , , , beep(), - . , ?

+3

, , "beep". - , .

- , .lib's

, ;)

void beep() {
  printf ("beep\n");
}
+1

All Articles