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

Which of these functions is safer to use : fgets(), gets()? Why?

1094


What are the advantages and disadvantages of c language?

1013


Can we access the array using a pointer in c language?

1044


Explain data types & how many data types supported by c?

1083


What is the use of printf() and scanf() functions?

1122


write a program in c language to print your bio-data on the screen by using functions.

6781


What is s in c?

1047


What is the difference between memcpy and memmove?

1016


Explain union. What are its advantages?

1075


Explain why can’t constant values be used to define an array’s initial size?

1350


Explain what are the __date__ and __time__ preprocessor commands?

1115


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1162


Who invented bcpl language?

1194


Tell me the use of bit field in c language?

1063


What are the application of void data type in c?

1189