Storing in RAM or Flash?

Hello all, I am making a web-interface type program to control a few things over a LAN and I have a basic (newbie) question about what memory I am taking up so to speak when I make my code. My program is hundreds of lines long, I just need clarification on one item so I will make up some code. When I am making my program, lots of the text is static so not assigned to variables. Is this stored on the flash program memory or the RAM?

String value = “brown”; // I assume this goes into RAM being a variable

client.print("

Hair color is: “); // Is this stored in flash since it doesn’t change?
client.print(value);
client.print(”

"); // this as well

String value = "brown";                  // I assume this goes into RAM being a variable

It does, and is really not advised.

client.print("<p> Hair color is: ");        // Is this stored in flash since it doesn't change?

All literal strings are stored in flash. They are also stored in SRAM at run time, unless you use the F() macro (and the appropriate version of the IDE).

PaulS:

String value = "brown";                  // I assume this goes into RAM being a variable

It does, and is really not advised.

Mind explaining why and suggesting an alternative?

The String object issues are well documented on these forums and the issue comes up at least a half dozen times a day. Hell, a quick Google of "Arduino String object" will lead you to a big discussion on the topic.

PaulS:
]
All literal strings are stored in flash. They are also stored in SRAM at run time, unless you use the F() macro (and the appropriate version of the IDE).

Another noob question, SRAM ? Is this the same RAM other variables will be stored in? If so the F() macro will free up the aforemention SRAM?

Edit: I should say “not use to begin with” instead of “free up”.

Another noob question, SRAM ? Is this the same RAM other variables will be stored in?

Yes.

If so the F() macro will free up the aforemention SRAM?

Yes (as in not cause it to be used in the first place).