tried to make this encryption program but it doesn't work, I know I must have done something wrong, but I don't know how to correct it. A more effective solution to my "if dWord is higher than 118" would be nice, thx for help:)
here's the code!
#include <iostream.h>
#include <string.h>
using namespace std;
int main()
{
string Word;
int x;
cout << "Enter Word You want to be encrypted >> ";
cin >> Word;
string dWord[] = "Hello World!";
int a = 0;
int number;
number:
cout << "Enter a number between 0-10 >> ";
cin >> number;
if (number > 10 | number < 1) {
goto number;
}
for (int i = 0; dWord[a] > 0; ++a) {
dWord[a] = (int)dWord[a];
if ((int)dWord[a]==118) {
(int)dWord[a] = 32;
}
if ((int)dWord[a]==119) {
(int)dWord[a] = 33;
}
if ((int)dWord[a]==120) {
(int)dWord[a] = 34;
}
if ((int)dWord[a]==121) {
(int)dWord[a] = 35;
}
if ((int)dWord[a]==122) {
(int)dWord[a] = 36;
}
if ((int)dWord[a]==123) {
(int)dWord[a] = 37;
}
if ((int)dWord[a]==124) {
(int)dWord[a] = 38;
}
if ((int)dWord[a]==125) {
(int)dWord[a] = 39;
}
if ((int)dWord[a]==126) {
(int)dWord[a] = 40;
}
dWord[a] = dWord[a] + number;
cout << (char)dWord[a];
}
cin.get();
cin.get();
return 0;
}
}