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 the difference between NULL and NUL?
How to declare pointer variables?
What is array within structure?
what value is returned to operating system after program execution?
What is dynamic dispatch in c++?
Write a program to check prime number in c programming?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
Do pointers store the address of value or the actual value of a variable?
Is file a keyword in c?
Are pointers integers in c?
What is a ternary operator in c?
How many header files are in c?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
What are the advantages of using linked list for tree construction?
Do pointers need to be initialized?