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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:59:47+00:00 2026-05-26T12:59:47+00:00

I have recently become a teaching assistant for a university course which primarily teaches

  • 0

I have recently become a teaching assistant for a university course which primarily teaches C. The course standardized on C90, mostly due to widespread compiler support. One of the very confusing concepts to C newbies with previous Java experience is the rule that variable declarations and code may not be intermingled within a block (compound statement).

This limitation was finally lifted with C99, but I wonder: does anybody know why it was there in the first place? Does it simplify variable scope analysis? Does it allow the programmer to specify at which points of program execution the stack should grow for new variables?

I assume the language designers wouldn’t have added such a limitation if it had absolutely no purpose at all.

  • 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-26T12:59:48+00:00Added an answer on May 26, 2026 at 12:59 pm

    In the very beginning of C the available memory and CPU resources were really scarce. So it had to compile really fast with minimal memory requirements.

    Therefore the C language has been designed to require only a very simple compiler which compiles fast. This in turn lead to “single-pass compiler” concept: The compiler reads the source-file and translates everything into assembler code as soon as possible – usually while reading the source file. For example: When the compiler reads the definition of a global variable the appropriate code is emitted immediately.

    This trait is visible in C up until today:

    • C requires “forward declarations” of all and everything. A multi-pass compiler could look forward and deduce the declarations of variables of functions in the same file by itself.
    • This in turn makes the *.h files necessary.
    • When compiling a function, the layout of the stack frame must be computed as soon as possible – otherwise the compiler had to do several passes over the function body.

    Nowadays no serious C compiler is still “single pass”, because many important optimizations cannot be done within one pass. A little bit more can be found in Wikipedia.

    The standard body lingered for quite some time to relax that “single-pass” point in regard to the function body. I assume, that other things were more important.

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

Sidebar

Related Questions

I have recently become interested in the field(s) of data mining and machine learning.
Have recently been given a project to complete which uses XML quite extensively.Am looking
I have recently become an intern on a startup online classroom system. So now,
Recently, I have become increasingly familiar with Django. I have a new project that
I've recently set some coursework for some undergraduate students for which they have to
I have recently become a T4MVC fanatic and now I seem incapable of using
I've recently become familiar with Reflection , and have been experimenting with it, especially
I have recently become thread curious on iOS. Please point me in the direction
While I have written plenty of recursive parsers before, I have recently become interested
Recently I have become a fan of storing various settings used for my testing

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.