
-----------------------------------
Bo0sT
Sun Sep 07, 2008 1:40 am

Please comment on my program (Simple TXT Writer)
-----------------------------------
I wrote this program so that I can post it and learn from feedback that others give me.  If you could please look through my program and maybe point out something that I could have done better and/or how to fix any of all the bugs I have posted in the top comments that would be cool, thanks.  I commented it well so it is easy to look through, feel free to put it into your own IDE and compile it and test it, i only used standard C++ libraries so it should run on any IDE.


/*
 * Simple TXT Writer, by Danny Knight
 * Saturday, September 6, 2008
 * 
 * This program was made as practice with
 * many basic and standard C++ concepts
 * and libraries.  I commented everything
 * in great detail so that others can 
 * learn from it.
 *
 * Bugs ----------------------------------
 * -when writing to a file, after you have
 *  entered a line, you cannot go back and
 *  edit the line
 * -cannot enter a file name greater than
 *  one word long
 * -after adding to a text file, the new
 *  and old data are seperated by a blank
 *  line (I did not do this on purpose, I
 *  just couldn't figure out a quick and
 *  easy way to fix it)
 */

#include  // Standard C++ input / output stream
#include  // C++ string type
#include  // Standard C++ file stream

using namespace std; // Using standard namespace for standard C++ libraries

static void create_file(void); // Is run when the 'Create TXT' option is selected
static void open_file(void); // Is run when the 'Open TXT' option is selected 
void cannot_open_file(char* title_of_file); // Displays an error message including the name of the file as an ARRAY OF CHARs to the standard output stream and exits the program returning '1'
void cannot_open_file(string title_of_file); // Displays an error message including the name of the file as a STRING to the standard output stream and exits the program returning '1'
void cannot_open_file(); // Displays an error message to the standard output stream and exits the program returning '1'

void main()
{
	char option = ' '; // char being used to store the user's menu option

	while (!(option == 'e' || option == 'E'))
	{
		cout 