Hi
I am writing a toy encryption method objecy oriented program in which user enters a statement, and each character in the statement is replaced by another character which are stored in a 2D array.
I have created a static array in which each alphabet has a value in 2D array something like this and the program also.... I am having problem in the code with red area...
Actually i am going worng in compairng..Could anyone please help me..
#include<iostream.h>
#include<iomanip.h>
#include<fstream.h>
#include<conio.h>
#include<stdio.h>
const int row =26;
const int col= 2;
const char tarray[row][col]=
{
{'A', '?'},
{'B', '!'},
{'C', '.'},
{'D', ';'},
{'E', ':'},
{'F', '|'},
{'G', '^'},
{'H', ','},
{'I', '%'},
{'J', '$'},
{'K', '>'},
{'L', '<'},
{'M', '='},
{'N', '['},
{'O', ']'},
{'P', '+'},
{'Q', '-'},
{'R', '*'},
{'S', '/'},
{'T', '#'},
{'U', '@'},
{'V', '&'},
{'W', '('},
{'X', ')'},
{'Y', '{'},
{'Z', '}'}
};
class toymethod
{
char string[30];
public:
void encrypt();
void decrypt();
};
void toymethod::encrypt()
{
int k;
cout<<"Enter the string \n";
cin.getline(string,20);do
{
if(strcmp(string,tarray)==0)
cout<<tarray[j];
else
cout<<"Character not found \n";
}while(i<26);
}void toymethod::decrypt()
{
}
void main()
{
toymethod t1;
t1.encrypt();
}
Please help me...THanks in advance...Bye