0

Can we call one function into another function in C language?(not in main() one)

void column (int arr[][]) { transpose(); Rest operation; }

12th May 2021, 9:50 AM
Sanchit Pahwa
Sanchit Pahwa - avatar
12 Respostas
+ 3
Ofc you can.
12th May 2021, 9:57 AM
sarada lakshmi
sarada lakshmi - avatar
+ 2
Yes you can call same in recursion we calling function again an again
12th May 2021, 9:53 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Sanchit Pahwa yes you saying correct u cannot define function inside function but you can call function inside function defined and calling are different things
12th May 2021, 10:40 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Thx amit🤓
12th May 2021, 10:41 AM
Sanchit Pahwa
Sanchit Pahwa - avatar
0
No I am not asking about recursion rather I am asking about nested function as the snippet of code I have mentioned
12th May 2021, 10:15 AM
Sanchit Pahwa
Sanchit Pahwa - avatar
0
You can't write function inside function like this Void function () { int function(){} } This is invalid but yes we can call hope u understood
12th May 2021, 10:28 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
It shows compile time error so how we can call it
12th May 2021, 10:30 AM
Sanchit Pahwa
Sanchit Pahwa - avatar
0
Sanchit Pahwa try this program hope this will clear your doubts #include <stdio.h> void print(){ printf ("hii"); } int main() { printf("hello"); // main(); print(); return 0; }
12th May 2021, 10:34 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
Main() ke ilawa amit bhai (as I mentioned in question also😅)
12th May 2021, 10:36 AM
Sanchit Pahwa
Sanchit Pahwa - avatar
0
Sanchit Pahwa hahaha i have already commented main function you can check paste same code on solo c plateform
12th May 2021, 10:37 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
Nested function is not supported by C because we cannot define a function within another function in C. We can declare a function inside a function, but it's not a nested function. ... Therefore, nested functions have only a limited use. If we try to approach nested function in C, then we will get compile time error.
12th May 2021, 10:38 AM
Sanchit Pahwa
Sanchit Pahwa - avatar