int main (int nNumberofArgs, char* pszArgs)
{
int a=1;
int b=2;
int c=3;
int d=4;
int e=5;
int f=6;
int g=7;
int h=8;
int i=9;
int j=10;
int k=11;
int l=12;
int m=13;
int n=14;
int o=15;
int p=16;
int q=17;
int r=18;
int s=19;
int t=20;
int u=21;
int v=22;
int w=23;
int x=24;
int y=25;
int z=26;
int name;
cout<<"Write the text you want to be encrypted: ";
cin>> name;
return 0;
}
I dont know what i need to have in the gap. I wan the program to see the word that was typed in and take each letter and make it a number. I wouldn't use IF statments right??
http://www.cplusplus.com/reference/stl/map/ Try this data structure. A map is made of key/value pairs so in your case each letter would be a key and each corresponding number would be a value;
Also you want to take a character array as input not an int. Then iterate through the character array in a for loop and check each character with an if statement.
something like this
1 2 3 4 5
char* test = "test";
for( char* c = test; *c != NULL; c++ )
{
}