Answer Posted / nimish salve
yes it is possible to define a function inside function.but only in optimized compiler like GCC,DEV C and not in turbo c,visual c++.
try this code
#include<stdio.h>
void fun1(void)//function definition 1
{
printf("Inside fun1\n");
void fun2(void)//function definition for 2nd function
{
printf("Inside fun2\n");
}
fun2();//function call
}
int main()
{
printf("Inside Main\n");
fun1();//function call
return 0;
}
try in both GCC and TurboC and get your answer
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is C language ?
What is pointers in c?
What are the differences between Structures and Arrays?
How to write a code for reverse of string without using string functions?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
Can a pointer be volatile in c?
How to declare pointer variables?
What does calloc stand for?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
What is structure of c program?
What does struct node * mean?
What should malloc(0) do?
Does c have enums?
What does the && operator do in a program code?
Can you please explain the difference between syntax vs logical error?