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...


Why the use of alloca() is discouraged?

Answers were Sorted based on User's Feedback



Why the use of alloca() is discouraged? ..

Answer / johnson

Sorry, that is not strictly correct. According to the man page:

"The alloca() function allocates size bytes of space in the
stack frame of the caller, and returns a pointer to the
allocated block. This temporary space is automatically freed
when the caller returns."

Now this is the real reason:
" If the allocated block is beyond the current stack limit,
the resulting behavior is undefined."

Is This Answer Correct ?    12 Yes 0 No

Why the use of alloca() is discouraged? ..

Answer / sathish kumar

Hi All,

If you use alloca inside a function when it retuns from
function it will be resulting in memory leak. Thats why
its discouraged to use.

Thanks & Regards
Sathish Kumar

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More C Interview Questions

What is wild pointer in c?

0 Answers  


To what value do nonglobal variables default? 1) auto 2) register 3) static

4 Answers  


What is indirect recursion? give an example?

4 Answers  


Write a C program to perform some of the operation which can be performed using Single linked list

1 Answers   Qualcomm,


Define Spanning-Tree Protocol (STP)

0 Answers  


in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?

11 Answers   IBM,


main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }

6 Answers  


What is malloc return c?

0 Answers  


What is function in c with example?

0 Answers  


WHY DO WE USE A TERMINATOR IN C LANGUAGE?

2 Answers  


An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above

0 Answers  


Print all numbers which has a certain digit in a certain position eg: number=45687 1 number=4 2 number=5 etc

4 Answers  


Categories