+ 5
In C ,What happen if i unuse the calling function[not a variable] ? i.e user defined function.
Is this unused function occupies some memory? after running Or it will disappear while running that code? That code is given below... https://code.sololearn.com/c29u8cMBl5vk/?ref=app
11 Réponses
+ 4
If your compiler has optimizing features enabled then it is likely that the function call and function code will be entirely removed from the executable. That would depend on whether the optimizer can determine that removal of the function does not affect anything else.
+ 4
Luckily I still have not come across a compiler who called me a fool 😀.
+ 3
Martin Taylor , codemonkey ,Brian
See this below code.which is similar to the above code in this question....(with slight difference)
But when I run this code.This code shows warning......
Is this code also suitable to your's answers...? I mean
(i.e) is this data(int z) also ignored by the compiler ?
||
it will also occupy memory......?
I raise this code, because it shows warning....😅?
https://code.sololearn.com/c0E48BB8V4HR/?ref=app
+ 3
codemonkey surely I will ignore the compiler's warning
"Hey bro, you have a useless variable,fool!"😅
But ,can you tell me.is compiler ignore that unused variable by removing it [unused variable]?
Or it will add this unused variable in memory?
+ 3
Thanks you so much to all 🙌🙏for answering unused question.....
in sololearn....😅
[i.e question not even seen before || asked in sololearn like this 😁😂]
+ 2
Thank you Martin Taylor 😊
can you tell what is stack frame?😅
+ 2
Thanks to all🙌🙏
+ 2
Unused variables and functions do take up memory. They will generate errors but not warnings.