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
Difference between linking and loading?
What is the method to save data in stack data structure type?
What is break in c?
Explain the difference between getch() and getche() in c?
Explain what does the format %10.2 mean when included in a printf statement?
What is volatile variable in c with example?
If fflush wont work, what can I use to flush input?
What is "Hungarian Notation"?
What is main () in c?
What is a header file?
If the size of int data type is two bytes, what is the range of signed int data type?
Write a code of a general series where the next element is the sum of last k terms.
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
What is string function in c?
What are the different types of control structures?