- What does a break statement do? Which control structures use it?
The break statement unconditionally ends the execution of the smallest enclosing while, do, for or switch statement.
- In a loop, what is the difference between a break and continue statement?
The break terminates the loop. The continue branches immediately to the test portion of the loop.
- Where may variables be defined in C?
Outside a function definition (global scope, from the point of definition downward in the source code). Inside a block before any statements other than variable declarations (local scope with respect to the block).
- What is the difference between a variable definition and a variable declaration?
A definition tells the compiler to set aside storage for the variable. A declaration makes the variable known to parts of the program that may wish to use it. A variable might be defined and declared in the same statement.
- What is the purpose of a function prototype?
A function prototype tells the compiler to expect a given function to be used in a given way. That is, it tells the compiler the nature of the parameters passed to the function (the quantity, type and order) and the nature of the value returned by the function.
- What is type checking?
The process by which the C compiler ensures that functions and operators use data of the appropriate type(s). This form of check helps ensure the semantic correctness of the program.
- To what does the term storage class refer?
This is a part of a variable declaration that tells the compiler how to interpret the variable's symbol. It does not in itself allocate storage, but it usually tells the compiler how the variable should be stored.
Thursday, 26 May 2011
C program part3
Labels:
C,
Interview question
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment