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

What is pragma in c?

1144


What is union and structure in c?

1164


Differentiate between null and void pointers.

1128


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

1741


What is the translation phases used in c language?

1074


What is the use of typedef in structure in c?

927


what is a constant pointer in C

1104


Who is the main contributor in designing the c language after dennis ritchie?

965


What is an expression?

1013


What is action and transformation in spark?

1094


Is it possible to pass an entire structure to functions?

952


What are the 5 data types?

1064


What is the difference between int main and void main?

1007


Explain the difference between malloc() and calloc() function?

997


c program for searching a student details among 10 student details

2051