Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION.

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


Please Help Members By Posting Answers For Below Questions

Explain what are the different file extensions involved when programming in c?

1051


Tell us the use of fflush() function in c language?

1084


What is a ternary operator in c?

1055


what are bit fields? What is the use of bit fields in a structure declaration?

2042


Explain about the constants which help in debugging?

1306


What do you mean by keywords in c?

1080


Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result

1846


What are header files and explain what are its uses in c programming?

1063


What are the differences between new and malloc in C?

1069


What is the purpose of clrscr () printf () and getch ()?

1020


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

1955


How to throw some light on the b tree?

1019


What is getch c?

1239


What is #include called?

994


What is the difference between array and linked list in c?

1082