#include <iostream>
#include <cmath>
#include <string>
#include <cstdlib>
#include <cstring>
using namespace std;
int main()
{
char chouseing_alphabet[27]={'a', 'b', 'c', '\0'};
string abc[27];
cout << "This program encrypts messages using Ceaser Cipher\n";
cout << "NOTE:capital letters are not allowed in this program\n";
cout << "\n---------------------------------------------------------";
cout << "\n---------------------------------------------------------";
cout << "\nEnter plaintext or enter abc to use alphabet as plaintext:\n";
cin >> abc[27];
cout << "\n---------------------------------------------------------";
if ((&chouseing_alphabet[0] == abc[0])||(&chouseing_alphabet[1] == abc[1])||(&chouseing_alphabet[2] == abc[2]))
{
//custom_alphabet[27]=abc[27];
cout << "\nCustom alphabeth selected as plaintext\n";
//custom_alphabet[27]++;
//cout << custom_alphabet[0]++;
}
else
{
cout << "\nAlphabet selected as plaintext\n";
//char alphabet[27]={'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','\0'};
//alphabet[27]++;
//cout << alphabet[0]++;
}
system("PAUSE");
return 0;
} //program not finished...
//program not finished...
//program not finished...
//program not finished...
//program not finished...
//program not finished...

111100/11000
Recommended Answers
Jump to Posttry to use strcpy in assigning a value to chouseing_alphabet and strcmp in comparing the 2 string
Jump to Postif ((&chouseing_alphabet[0] == abc[0])
Why are you trying to compare the address of a variable with the value of another variable? abc[0] is not an address. If you only want to compare the two characters then remove the & address operator.
Jump to Post111100/11000: strcpy doesn't compare but compys from one string to another
you missed reading a word in my previous comment
... and strcmp in comparing the 2 string
All 9 Replies

111100/11000
zeroliken 79 Nearly a Posting Virtuoso
phorce 131 Posting Whiz in Training Featured Poster
phorce 131 Posting Whiz in Training Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

111100/11000
zeroliken 79 Nearly a Posting Virtuoso
111100/11000 commented: Thanks +0

111100/11000
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.