function to be defined inside other function 
Author Message
 function to be defined inside other function

As I know, there is no chance to define function inside another one
in C (this keeps program tidy and easy to underestand). But sometimes
you need use function which is not defined yet - you could include
declaration of funcion inside definition of another.


Sun, 07 Jun 1998 03:00:00 GMT  
 function to be defined inside other function

Quote:

>As I know, there is no chance to define function inside another one
>in C (this keeps program tidy and easy to underestand). But sometimes
>you need use function which is not defined yet - you could include
>declaration of funcion inside definition of another.

Better still, put the function declaration (prototype) at the head of the file,
outside any function - then it will be known to all functions in the file.

Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight


TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html



Sun, 07 Jun 1998 03:00:00 GMT  
 function to be defined inside other function
Hell to all.
        I got question about function to ask you all. C does not allow function
to be defined inside other function, is it true????
        I really appreciate that if you help me with this question and reply
via e-mail rather than post follow up in this newsgroups.

God bless you
John.



Mon, 08 Jun 1998 03:00:00 GMT  
 function to be defined inside other function


Quote:


>>As I know, there is no chance to define function inside another one
>>in C (this keeps program tidy and easy to underestand). But sometimes
>>you need use function which is not defined yet - you could include
>>declaration of funcion inside definition of another.

>Better still, put the function declaration (prototype) at the head of the file,
>outside any function - then it will be known to all functions in the file.

Better still, put it properly in a header file and include that header file in the
program so that if the function prototype changes, you have to change only at one
location in the header file instead of changing it in all the source files.

--
/* --------------------------------------------------------

http://www.eskimo.com/~mag/index.html
***********************************************************
To understand recursion one must first understand recursion
***********************************************************
-------------------------------------------------------- */



Fri, 12 Jun 1998 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. define functions inside a subroutine

2. Why I am getting Error C2091: function returns function

3. declaring functions inside other functions

4. Setting a pointer to a function, inside a function

5. Function inside another function?...

6. printing function name and arguments from inside a function

7. Function pointer to function inside class

8. I am custom Traverse97 Programmer, seeking others.

9. I am having problems setting up that a specified dialog is displayed before any others

10. #defines with #defines inside them?

11. #define with several #defines inside???

12. Preprocessor: defining a macro inside a #define directive

 

 
Powered by phpBB® Forum Software