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 9214223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:55:45+00:00 2026-06-18T01:55:45+00:00

Some example i run into for a program that deals with menu.. He declared

  • 0

Some example i run into for a program that deals with menu..

He declared all the function before the main function as i understand should be, and then one of the function that is a void function was also mentioned inside the main:

char get_choice(void);
char get_first(void);
int get_int(void);
void count(void);
int main(void)
{
    int choice;
    void count(void);
    while ( (choice = get_choice()) != 'q')
    {
        switch (choice)
        {
            case 'a' : printf("Buy low, sell high.\n");
                break;
            case 'b' : putchar('\a'); /* ANSI */
                break;
            case 'c' : count();
                break;
            default : printf("Program error!\n");
                break;
        }
    }
    printf("Bye.\n");

…(functions implementations)

Can you please tell me why is that?
tnx

  • 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-06-18T01:55:46+00:00Added an answer on June 18, 2026 at 1:55 am

    These are just declaration of the functions not definitions.Not too sure why count function is declared twice though.The declaration is just saying to the compiler that there is something there with this name.Perhaps the programmer forgot to define the method?

    A declaration provides basic attributes of a symbol: its type and its name. A definition provides all of the details of that symbol–if it’s a function, what it does; if it’s a class, what fields and methods it has; if it’s a variable, where that variable is stored.

    eg declaration looks like this:

    void count(void);
    

    eg definition looks like this:

    void count(void){
    
    ......
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a program where main process forks into 4 children that cooperate with
I'm trying to build and run some of the example apps included in the
I need to run some code, for example, to detect browser prefered languages and
Just some example code here, but I have lists of strings that I want
Here's some example code: class Obj attr :c, true def == that p '=='
Im writing a program and I've run into an issue where I need the
I have a set of commands that I'd like to run and do some
I'm copying some objects into a file and they all are derieved from same
I am making a program that needs some of the Java libraries installed already
I've run into a problem with an iPhone core data application that I'm working

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.