Skip to main content
Tweeted twitter.com/#!/StackArduino/status/503541252164706304

How doesis stack memory used for fuctions and local variables?

I wanted to save some values to the EEPROM and also wanted to free up SRAM by avoiding some variable declarations., but EEPROM memory is byte wise. 

If I want to store an int value, I have to use some expressions repeatedly. I thought I would make some functions for those. But I am concerned that, if I create a function, it would still occupy SRAM memory, better I declare an int variable instead of using EEPROM. My question is, how

How are the functions and the local variables are stored in SRAM? IsDoes it only store the address of the fuction pointer from the flash memory or all the variables and commands are stores instored on the stack?

How does stack memory used for fuctions and local variables?

I wanted to save some values to the EEPROM and also wanted to free up SRAM by avoiding some variable declarations. but EEPROM memory is byte wise. If I want to store int value, I have to use some expressions repeatedly. I thought I would make some functions for those. But I am concerned that, if I create a function, it would still occupy SRAM memory, better I declare an int variable instead of using EEPROM. My question is, how the functions and the local variables are stored in SRAM? Is it only store the address of the fuction pointer from the flash memory or all the variables and commands are stores in the stack?

How is stack memory used for fuctions and local variables?

I wanted to save some values to the EEPROM and also wanted to free up SRAM by avoiding some variable declarations, but EEPROM memory is byte wise. 

If I want to store an int value, I have to use some expressions repeatedly. I thought I would make some functions for those. But I am concerned that, if I create a function, it would still occupy SRAM memory, better I declare an int variable instead of using EEPROM.

How are the functions and the local variables stored in SRAM? Does it only store the address of the fuction pointer from the flash memory or all the variables and commands are stored on the stack?

Source Link

How does stack memory used for fuctions and local variables?

I wanted to save some values to the EEPROM and also wanted to free up SRAM by avoiding some variable declarations. but EEPROM memory is byte wise. If I want to store int value, I have to use some expressions repeatedly. I thought I would make some functions for those. But I am concerned that, if I create a function, it would still occupy SRAM memory, better I declare an int variable instead of using EEPROM. My question is, how the functions and the local variables are stored in SRAM? Is it only store the address of the fuction pointer from the flash memory or all the variables and commands are stores in the stack?