The structure is simple. Pay attention to placement of curly braces and semicolons, specifically, where they are NOT.
// The next line is a function signature to tell the compiler that
// the actual function will follow later. You either need a signature
// or the actual function to appear before it is ever used anywhere.
// note the ...
Strings are immutable. That means that when they are declared, the memory allocated to them cannot be changed. You can put a shorter string in that memory, but not a longer one because it will overwrite other memory allocated elsewhere.
When plaintext is declared in the second code snipet, it has exactly one byte allocated to it, to hold the end of string ...