I have came across the following code, and being a C beginner, I came here for your help.
This function is from a c implmentation of a queue.
Bool queuePut(Queue *q, char c)
{
void beep();
if (queueFull(q))
{
beep();
return false;
}
//do stuff
return true;
}
So, I am getting a strange error with gcc on the void beep(). Can someone please explain me what is this, declaring a function inside a function. Or is it the void beep() simply out of place? I was given this code and there's always the possibility that it isn't correct.
Edit: The error I am getting:
c:/djgpp/tmp/src/ccrjtmBh.o:queue.c:(.text+0x50): undefined reference to
'_beep'
collect 2: ld returned 1 exit status.
Is this a linking error?