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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:39:49+00:00 2026-06-07T14:39:49+00:00

A tutorial said You cannot declare functions within a block as static. What is

  • 0

A tutorial said

You cannot declare functions within a block as static.

What is the reason?How does it affect the function?

  • 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-07T14:39:51+00:00Added an answer on June 7, 2026 at 2:39 pm

    static when applied to functions means that the function has internal linkage. i.e. it can be accessed within this file only. In other words it has file-scope. This linkage applies irrespective of whether you declare a function inside another function or outside of all of them.

    Now, if you apply the static keyword to a function declaration inside another block/function, semantically speaking, you are trying to restrict the scope of the function to that particular block/function, which goes against the language rules that state that static functions, irrespective of their place of declaration, shall have file-scope.

    And hence, the standard might be prohibiting such a declaration.

    PS: Footnote 30 in 6.2.3 in the latest C11 standard states-

    A function declaration can contain the storage-class specifier static
    only if it is at file scope;

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

Sidebar

Related Questions

ajax tutorial on w3school at http://www.w3schools.com/ajax/ajax_database.asp In this function (function GetXmlHttpObject()), it creates a
I just started looking into Raphael, and every tutorial said that you may draw
I am trying to learn Java, I was reading a tutorial that said something
I'm going through a tutorial and it said this command, git branch -a would
I'm following a tutorial and it said at one point it should compile, but
I am new to Android development. To implement a photo gallery app, tutorial said
I read some tutorial about threads and processes, it is said that the processes
I'm trying to go through Hello World tutorial to the CodeIgniter, but cannot get
I've made some unit tests (in test class). The tutorial I've read said that
As said in the following IBM tutorial, http://public.dhe.ibm.com/software/dw/xml/x-springandroid/x-springandroid-pdf.pdf I have tried to create a

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.