so, here what's i'm trying to do,
when user enter ant statement, the output result will be cipher to numbers, so, i try to assign character to array, when i try to run the code, error occur at array declaration, here what i've got so far:
when user enter ant statement, the output result will be cipher to numbers, so, i try to assign character to array, when i try to run the code, error occur at array declaration, here what i've got so far:
Code:
#include<iostream.h>
class Cipher{
private:
char code[1] = A;
char code[2] = B;
char code[3] = C;
char code[4] = D;
char code[5] = E;
char code[6] = F;
char code[7] = G;
char code[8] = H;
char code[9] = I;
char code[10] = J;
char code[11] = K;
char code[12] = L;
char code[13] = M;
char code[14] = N;
char code[15] = O;
char code[16] = P;
char code[17] = Q;
char code[18] = R;
char code[19] = S;
char code[20] = T;
char code[21] = U;
char code[22] = V;
char code[23] = W;
char code[24] = X;
char code[25] = Y;
char code[26] = Z;
public:
void SetCode();
void GetCode();
};
void Cipher::SetCode()
{
cout<<"Enter Cipher Code:";
cin>> code;
};
void Chiper::GetCode()
{
cout<<"Chiper Result:"<<code;
cout<<"\n";
};
int main()
{
Cipher Code1;
Code1.SetCode();
Code1.GetCode();
return 0;
};
Comment