memory usage for const type

Is it possible that if I declare a const variable like this one

const char myToken[]="424069639-n2OyUifdsfdsggBUYG2NOI230qnVYDgisbY";

it will automatically be stored in the code space of memory or in the EEPROM and not in the RAM?

No, that will be stored in RAM (though it will first have been copied there from flash memory, before "main" executes). Have a look at "PROGMEM"

the problem is that using this function:

// this function will return the number of bytes currently free in RAM
// written by David A. Mellis
// based on code by Rob Faludi

int availableMemory() {
  int size = 8192; // Use 2048 with ATmega328, 1024 with ATmega 168, 8192 con il 2560
  byte *buf;

  while ((buf = (byte *) malloc(--size)) == NULL)


  return size;

declaring or not a const value the free memory space deoesn't change. I can't explain myself why...

Because whether or not you declare the string "const", it will consume strlen (string) + 1 bytes of RAM.

yes that's ok. But my problem is that if i comment the declaration or not the ram usage is always the same!

If you can comment-out the string declaration, it suggests you're not using it anywhere (otherwise, the compiler would complain), so that suggests the string is being optimised away.