char mName ;
is a so called "C-string". It's an array of 51 characters, the last of which is reserved for the delimiter character '\0'.
Typically, magic numbers like this are frowned upon, because it's bad practice. I'll show you a better way of doing it later on.
extracts characters from the stream (input) and stores them in a C-string, in this case, mName. It continues extracting until a delimiting character is reached, or until n
characters have been extracted (where n
is the second parameter, in this case 50).
In the context of this program, std::cin.getline() is more applicable than std::cin, because std::cin is picky about white-space characters, where as getline is not. This is important because movie titles may have spaces in them.
sets the floatfield format flag for the specified stream, which means you're using fixed floating point notation.
sets the decimal precision for outputted floating point values for the specified stream.
Look at this documentation for an example and additional info:
Anyhow, like I said, magic numbers aren't really a good thing. Here would have been a better way to do it.
const unsigned short NAME_LEN = 51;