DO NOT COPY AND PASTE CODE!!
I'm not a big C++ coder, I found a few potential problems with your code (depending on your compiler):
Code:
#include <iostream>
Some compilers are looking for the .h extension and will give an error #include <iostream.h>
You also created some very odd arrays:
The 6 means each array is has a maximun of 6 characters but you try to manually assigned a value into the 7th position of the array. The first array value starts at position 0 not *:
Its hard to critique code when its not your language but this would be the easiest way for you to perform the same task. This might not be the correct syntax for C++ but this is how I would rewrite the code:
Code:
#include <iostream>
#include <string.h>
using namespace std;
void wait4user();
int main()
{
string psword[6];
char p[6];
cout << "Please enter 6 digit password, and press enter after each digit\n";
cin >> psword;
cout << "\n\aEncryption will now begin\n";
int salt=*
for(i=0;i<psword.length();i++)
{
p[i]=int psword[i]+salt;
salt=salt+2;
}
cout << "Here is your new password!\n";
cout << p;
cout << " \n";
cout << "Press Enter to terminate program...";
wait4user();
return 0;
}
void wait4user()
{
std::string response;
std::cout << "Press Enter to continue";
std::getline(std::cin, response);
}
Last edited by SyntaXmasteR; 09-22-2006 at 02:12 PM.
[url=http://www.syntax******.info/tools/services.php]Speed Up Windows XP[/url]
[url=http://www.syntax******.info/tools/ip.php]Get An Ip Address[/url]
[url=http://www.syntax******.info/tools/base_converter.php]Base Converter[/url]
--------------------------------
[URL=http://www.boninroad.com/syntax******/]Old Site[/URL]
[URL=http://www.syntax******.info]Comming Soon[/URL]