why doesn''t c have nested functions, Computer Engineering

It's not trivial to execute nested functions such that they have the proper access to local variables in the having function(s), so they were deliberately left out of C as a simplification. (gcc does permit them, as an extension.) For many potential uses of nested functions (e.g. qsort comparison functions), an adequate if slightly difficult solution is to use an adjacent function with static declaration, communicating if essential via a few static variables. (A cleaner solution, by unsupported by qsort, is to pass around a pointer to a structure containing the essential context.)              

 

 

Posted Date: 4/8/2013 3:08:58 AM | Location : United States







Related Discussions:- why doesn''t c have nested functions, Assignment Help, Ask Question on why doesn''t c have nested functions, Get Answer, Expert's Help, why doesn''t c have nested functions Discussions

Write discussion on why doesn''t c have nested functions
Your posts are moderated
Related Questions
Explain about Magnetic tape      a) They are mostly used for keeping files of data  b )It is one of the cheapest and slowest methods for storage

When can a user program execution be interrupted? It won't be desirable to interrupt a program when an instruction is being executed and is in a state such as instruction decod

Interfacing Subroutines with Parameter Passing Let's now write a C program which calls the assembly program for parameter passing. Let's extend the previous two programs such t

E ngaged tone is generated in the: (A)  Telephone instrument of calling subscriber (B)  Telephone instrument of called subscriber (C)  Exchange (D)  Repeater

What is the 2's complement of the number 1101101 ? Ans. 0010011 is the 2's complement of the number 1101101. As 1's complement of the number 1101101 is 0010010 and 2's comple

Quality of Service: This is assessed on the basis of customer's satisfaction.

Illustrate what are the Multimedia applications Multimedia comprise the use of a computer to present: - Text - Video - Graphics - Sound - Animation In an inte

Elucidate in brief the functions of the clock generator chip, 8284. 8284 Clock generator: 8284 is an ancillary component to the microprocessors. Without clock generator, many

What are event and its types? An event is an occurrence at a point in time, like user depresses left button. Event happens instantaneously with regard to time scale. Type

consider an open circuit pn junction.sketch curves as a function of distance across the junction of space charge ,electric field and potential