i am trying to create a massive list of letters and numbers using this program. but for some reason i keep getting an error (sometimes this occurs, sometimes it doesn't)
error PRJ0002 : Error result 31 returned from 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\mt.exe'.

i also get(sometimes this occurs, sometimes it doesn't)
Unhandled exception at 0x00b75c49 in PassWord.exe: 0xC0000005: Access violation reading location 0x00000006.


the panel for the output gets filled up with this much output so i cannot see all the results also.
the big problem is that i am not even halfway done with the list i want to print out. can anyone help me out?

#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;

int main()
{
	int COne = 0, CTwo = 0, CThree = 0, CFour = 0, CFive = 0, CSix = 0, CSeven = 0;
	int ROne = 1, RTwo = 2, RThree = 3, RFour = 4, RFive = 5, RSix = 6, RSeven = 7;
	int End = 0;
	const int X = 62, Y = 7;

	const string Characters[Y][X]=
	{
		{ "a", "A", "b", "B" , "c", "C", "d", "D", "e", "E", "f", "F", "g", "G" , "h", "H", "i", "I", "j", "J", "k", "K", "l", "L", "m", "M", "n", "N", "o", "O", "p", "P", "q", "Q", "r", "R", "s", "S", "t", "T", "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"},
		{ "a", "A", "b", "B" , "c", "C", "d", "D", "e", "E", "f", "F", "g", "G" , "h", "H", "i", "I", "j", "J", "k", "K", "l", "L", "m", "M", "n", "N", "o", "O", "p", "P", "q", "Q", "r", "R", "s", "S", "t", "T", "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"},
		{ "a", "A", "b", "B" , "c", "C", "d", "D", "e", "E", "f", "F", "g", "G" , "h", "H", "i", "I", "j", "J", "k", "K", "l", "L", "m", "M", "n", "N", "o", "O", "p", "P", "q", "Q", "r", "R", "s", "S", "t", "T", "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"},
		{ "a", "A", "b", "B" , "c", "C", "d", "D", "e", "E", "f", "F", "g", "G" , "h", "H", "i", "I", "j", "J", "k", "K", "l", "L", "m", "M", "n", "N", "o", "O", "p", "P", "q", "Q", "r", "R", "s", "S", "t", "T", "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"},
		{ "a", "A", "b", "B" , "c", "C", "d", "D", "e", "E", "f", "F", "g", "G" , "h", "H", "i", "I", "j", "J", "k", "K", "l", "L", "m", "M", "n", "N", "o", "O", "p", "P", "q", "Q", "r", "R", "s", "S", "t", "T", "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"},
		{ "a", "A", "b", "B" , "c", "C", "d", "D", "e", "E", "f", "F", "g", "G" , "h", "H", "i", "I", "j", "J", "k", "K", "l", "L", "m", "M", "n", "N", "o", "O", "p", "P", "q", "Q", "r", "R", "s", "S", "t", "T", "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"},
		{ "a", "A", "b", "B" , "c", "C", "d", "D", "e", "E", "f", "F", "g", "G" , "h", "H", "i", "I", "j", "J", "k", "K", "l", "L", "m", "M", "n", "N", "o", "O", "p", "P", "q", "Q", "r", "R", "s", "S", "t", "T", "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}
	};

	while (End != 1){
	
		if(COne < 62)
		{
			cout<<endl;
			cout<< Characters[ROne][COne];
			cout<< Characters[RTwo][CTwo];
			cout<< Characters[RThree][CThree];
			cout<< Characters[RFour][CFour];
			cout<< Characters[RFive][CFive];
			cout<< Characters[RSix][CSix];
			cout<< Characters[RSeven][CSeven];
			++COne;

			if(COne == 62 && CTwo != 63)
			{
				cout<<endl;
				COne = 0;
				++CTwo;
				cout<< Characters[ROne][COne];
				cout<< Characters[RTwo][CTwo];
				cout<< Characters[RThree][CThree];
				cout<< Characters[RFour][CFour];
				cout<< Characters[RFive][CFive];
				cout<< Characters[RSix][CSix];
				cout<< Characters[RSeven][CSeven];
				if(CTwo == 63)
				{
					End = 1;
				}
			}
		}

	};
	

	cin>>COne;

	return 0;
}

Try starting with a smaller problem, you don't need to loop through the entire thing during development. Shorten the loops to 2 or 3iterations, and step through the code in a debugger, keeping an eye on the index variables, especially COne and CTwo, then if it looks right, go to 8 or 10, you will see the problem.

If you don't have a debugger, step through the code logically in your head, keeping track of the variable values.

Your problem is here (among other places):

if(COne == 62 && CTwo != 63)
{

You've declared a 2d-array with 7x62 elements. Which means you can access the following indexes: Characters[0-6][0-61], so when you try to access index 62, it crahes (or not, this is called undefined behaviour)

Your problem is here (among other places):

if(COne == 62 && CTwo != 63)
{

You've declared a 2d-array with 7x62 elements. Which means you can access the following indexes: Characters[0-6][0-61], so when you try to access index 62, it crahes (or not, this is called undefined behaviour)

this worked very well. thanks.
the output window still does not show all of the output, does anyone know how to make it hold more of the output this program produces?

this worked very well. thanks.
the output window still does not show all of the output, does anyone know how to make it hold more of the output this program produces?

i figured out my own problem there, i just made a text file and saved everything in there. thanks for all the help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.