The "r+" opens a file for reading and writing. This mode places the pointer at the beginning of the file.
The "w+" opens a file for reading and writing. If the file doesn't exist, then a new file is created. If the file exists, then the file is overwritten.
The "a+" opens a file for appending and reading. If the file doesn't exist, it creates a new file. If the file already exists, the pointer is placed at the end of the file.