`Hey,
Note: If you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
In a stack, the memory gets managed for you. You don’t have to allocate memory by hand, or free it once you don’t need it any more.
Reading from and writing to stack variables is very fast because the CPU organizes stack memory pretty efficiently.
A stack has size limits and the variables only exist while the function is running. Once a function exits, all the automatic variables get popped.
Kindly revert for any queries
Thanks.