0

I have a line in my program that outputs text one time at the beginning:

printf("Long text........");

So from my understanding, when I start my program, memory gets allocated for that string. Since this is running on a device with limited resources, can I free the memory that was allocated for that string after it has been printed?

TJJ
  • 155
  • 10
  • 1
    `memory gets allocated` - most probably not. The memory for the string literal most probably resides in read only memory, ex. in flash, not in ram, there is no "allocation" per se (well, hm, the "allocation" is done by the linker/compiler during compilation, when it decides where in flash to put the string literal). – KamilCuk Jun 10 '19 at 11:09
  • Oh, okay. Thank you very much for that informative answer! – TJJ Jun 10 '19 at 11:11

0 Answers0