constant variables

a variable "int" will be storage in SRAM memory. right?
a "const int" will be storage in SRAM memory or in flash memory?
how can i do for storage an array in a FLASH memory? only with PROGMEM?
my array is char img(5000);

Have you tried searching for PROGMEM on this site ?

how can i do for storage an array in a FLASH memory? only with PROGMEM?

Yes. Keep in mind that Flash memory is read-only.

What are you doing with 5000 bytes of image data?

leandrohat:
a variable "int" will be storage in SRAM memory. right?
Correct
a "const int" will be storage in SRAM memory or in flash memory?
SRAM
how can i do for storage an array in a FLASH memory? only with PROGMEM?
Correct, and you will need to use specific commands to read them back in your sketch from flash.
my array is char img(5000);

http://arduino.cc/en/Reference/PROGMEM
Lefty

Is "const int" likely to be optimized out of SRAM by the compiler?

Is "const int" likely to be optimized out of SRAM by the compiler?

Depends very much how it is used.

AWOL:

Is "const int" likely to be optimized out of SRAM by the compiler?

Depends very much how it is used.

Hmmm... after all it's just a typed #define. IOW, a literal...
* tuxduino thinks...

Hmmm... after all it's just a typed #define. IOW, a literal.

Ever tried taking the address of a #define?

AWOL:

Hmmm... after all it's just a typed #define. IOW, a literal.

Ever tried taking the address of a #define?

Well, I know a const is not a typed #define. I was just saying a const can be viewed as a literal.

Taking the address of a const variable is probably one of the things that prevents the compiler from optimizing them out...