On the stack characters take up a cell, like numbers. In memory they have their own size (one 8-bit byte on most systems), and therefore require their own words for memory access:
The preferred representation of strings on the stack is addr
u-count, where addr is the address of the first character and
u-count is the number of characters in the string.
v4 5 type
You get a string constant with
Make sure you have a space between s" and the string; s"
is a normal Forth word and must be delimited with white space (try what
happens when you remove the space).
However, this interpretive use of s" is quite restricted: the
string exists only until the next call of s" (some Forth systems
keep more than one of these strings, but usually they still have a
limited lifetime).
You can also use s" in a definition, and the resulting
strings then live forever (well, for as long as the definition):
Assignment:
Emit ( c -- )typescas character (not a number). Implementtype ( addr u -- ).
Reference: Memory Blocks.