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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:52:54+00:00 2026-06-05T17:52:54+00:00

The first program compiled properly.second gave error saying too few argument for foo… is

  • 0

The first program compiled properly.second gave error saying too few argument for foo…
is global declaration ignored by the compiler in both programs?

first program:

#include<stdio.h>
    void foo();
int main()
{
  void foo(int);
  foo(1);
  return 0;
}

void foo(int i)
{
   printf("2 ");
}

void f()
{
   foo(1);
}

second program:

void foo();
int main()
{
  void foo(int);
  foo();
  return 0;
}

void foo()
{
   printf("2 ");
}

void f()
{
   foo();
}
  • 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-05T17:52:55+00:00Added an answer on June 5, 2026 at 5:52 pm

    The inner declaration hides declarations at the global scope. The second program fails because the declaration void foo(int); hides the global declaration void foo();; so when you say foo within main you are referring to the one taking an int as argument.

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

Sidebar

Related Questions

I don't understand why the first program in JSP is working, but the second
my in program First call text from datadase then post it in textbox second
A .NET program is first compiled into MSIL code. When it is executed, the
I compiled the following code: // Triangle.cpp // Our first OpenGL program that will
I have compiled a simple ASP.NET project to test first data global gateway API
I am making my first program using Java3D. I have setup some transformGroups that
I wrote my first program almost fifty years ago (yes, coding is still a
I am making my first program with beautifulsoup and my html file has code
I have a concurrent program that needs bait of clarification. The first program is
Below are two programs that write 50,000,000 bytes to a file. The first program,

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.