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

  • Home
  • SEARCH
  • 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 9226653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:52:56+00:00 2026-06-18T04:52:56+00:00

I have one function that getting printing a menue and returning a choice. And

  • 0

I have one function that getting printing a menue and returning a choice. And another function to calculate 2 numbers that im getting from the user. Now, the calculation is depanding on the choice return from the first function, and im dont really know what is the right way to use 2 different type of functions together…this is both functions:

float calc(float number1, float number2)

{
    float answer;
    int operand;
    operand =get_choice();// problemmmm

}

char get_choice(void)

{
    char choice;

    printf("Enter the operation of your choice:\n");
    printf("a. add        s. subtract\n");
    printf("m. multiply   d. divide\n");
    printf("q. quit");

    while ((choice = getchar()) != 'q')
    {

        if (choice != 'a' || choice != 's' || choice != 'm' || choice != 'd')
        {
            printf("Enter the operation of your choice:\n");
            printf("a. add        s. subtract\n");
            printf("m. multiply   d. divide\n");
            printf("q. quit");
            continue;
        }
    }
    return choice;
}

I got an error saying “implicit function of get_choice is invalid in C99”

  • 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-18T04:52:58+00:00Added an answer on June 18, 2026 at 4:52 am

    That implicit function error probably means that the compiler doesn’t yet know about the get_choice function by the time it reaches the line when it gets called. You can fix this by either.

    1. Changing the order you write your functions in. Write get_choice before the calc function

    2. Add a declaration for the get_choice function before the calc function. The declaration would be just the function name and type, without the code:

      char get_choice(void);
      

    If you are wondering what the message was about, in C89 undeclared functions were implicitly assumed to return an integer. C99 is stricter and forces you to always declare functions but the error message still refers to the C89 style implicit declarations.

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

Sidebar

Related Questions

I have one function ParseHtmlTable(string htmlContent) . Now in that function I want to
I have one method that opens a file and passes off to another function
I have this function that switches the HTML contents from one element on a
I have a function that, when the user selects one or more items, it
i have one AJAX function getting results from php file as bellow $.ajax({ type:
I have one javascript function that used to display the menu and content in
I have a function that performs a monthly task on one or more specified
I have the following function that is supposed to trigger anytime one of the
I have one array. I want that array to retain its value between function
I have a win form that creates a site in IIS7. One function needs

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.