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.

Answers were Sorted based on User's Feedback



CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION...

Answer / rg

no!!! we cant define a func. inside a func.

Why u some people misguide others!!

go thru practice..

Is This Answer Correct ?    0 Yes 0 No

CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION...

Answer / anil kumar nahak

Yes we define any function(without main()) with in a function.

Is This Answer Correct ?    3 Yes 4 No

CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION...

Answer / punam

Thank you all. This was helpful to me. So, to summarize all this should I say:
1. In C, we cannot define a function inside another function.
2. However, main() function is an exception as we can define another function inside a main() function. This can be called nesting of function inside main(). The inner function cannot be called from any outside function. It can be called only from main().
3. The only way to access the inner function from outside main() is by passing a function pointer of type inner function.

Is This Answer Correct ?    0 Yes 1 No

CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION...

Answer / vrushali

Hi friends , it possible.
Please chk this simple program:
#include <stdio.h>

int main ()
{
int func1 ()
{
printf ("\n Inside func 1 ");
}
func1 ();
}
O/P : Inside func 1

Is This Answer Correct ?    9 Yes 17 No

CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION...

Answer / kojo maxwell

yes a function can be defined in a function.
for example;
int main()
{

}
int main is a function and in the curly brackets we could
still have functions.

Is This Answer Correct ?    16 Yes 51 No

Post New Answer

More C Interview Questions

How can I convert a number to a string?

0 Answers  


Write a program that accepts a string where multiple spaces are given in between the words. Print the string ignoring the multiple spaces. Example: Input: “ We.....Are....Student “ Note: one .=1 Space Output: "We Are Student"

6 Answers   IBM,


What is substring in c?

0 Answers  


class foo { public: static int func(const char*& p) const; }; This is illegal, why?

8 Answers   Google,


What is the explanation for the dangling pointer in c?

0 Answers  


What is the symbol indicated the c-preprocessor?

0 Answers  


How we add our function in liabrary as liabrary function. Exp. we want use our int factorical(int); function as int pow(int,int); function working in math header file.

1 Answers  


The __________ attribute is used to announce variables based on definitions of columns in a table?

0 Answers  


How to write a code for random pick from 1-1000 numbers? The output should contain the 10 numbers from the range 1-1000 which should pick randomly, ie ,for each time we run the code we should get different outputs.

12 Answers   NetApp,


main() { FILE *fs; char c[10]; fs = fopen(“source.txt”, ”r”); /* source.txt exists and contains “Vector Institute” */ fseek(fs,0,SEEK_END); fseek(fs,-3L,SEEK_CUR); fgets(c,5,fs); puts(c); }

1 Answers   Vector,


Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ... } c.x=0; do{ /*x unaltered within theloop*/ ... }while(x==0); d.# define TRUE 0 ... while(TRUE){ .... }

7 Answers   TCS,


What is modeling?

0 Answers  


Categories