Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 674347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:41:47+00:00 2026-05-14T00:41:47+00:00

I have came across the following code, and being a C beginner, I came

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:41:48+00:00Added an answer on May 14, 2026 at 12:41 am

    Most probably you are having a linking error because:

    void beep();
    

    is a prototype of a function that has to be defined elsewhere. In C you can’t define a function inside another one. Please, elaborate on the error you are getting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came across this c# code in a project today and I couldn't help
I came across this class while reading a C# book and have some questions.
I came across this recently, up until now I have been happily overriding the
I am prototyping some C# 3 collection filters and came across this. I have
The other day, I came across this construct: static_cast<size_type>(-1) in some example C++ code,
I came across the following code recently and would like to optimize it: Public
I've came across the following code, ok, not exactly but close. The point of
I came across the following code, and was told that it means that COL_8888_RED
I have just started python and came across something kind of strange. The following
Few months ago, I have came across a Silverlight tutorial of Eric Cartman (South

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.