Answer Posted / shiva
No.
in g++ you will be clearly notified that you can't define a
function inside another function
but gcc somehow allows following
#include <stdio.h>
int func2(int (*f)()){
(*f)();
return 0;
}
int main ()
{
int func1 ()
{
printf ("\n Inside func 1 ");
return 0;
}
printf("someting");
func1 (); //you can access this fuction inside
main(the function in which you declared func1) with the name
func1
func2(func1); // to access this function outside use
fucntion pointer as a argument
return 0;
}
o/p:
something
Inside func 1
Inside func 1
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain how to reverse singly link list.
What does dm mean sexually?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
How can you access memory located at a certain address?
What functions are used for dynamic memory allocation in c language?
how can use subset in c program and give more example
Can we assign string to char pointer?
What is echo in c programming?
How can you read a directory in a C program?
Is it better to use malloc() or calloc()?
what do you mean by enumeration constant?
What is #pragma statements?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
What is a nested loop?
How to create struct variables?