445,851 Members | 2,097 Online
Need help? Post your question and get tips & solutions from a community of 445,851 IT Pros & Developers. It's quick & easy.

# What kind of problem? C lang

 P: 40 *=A \$=E output: Encrypted Message: M\$\$T M\$ *T 1PM Decrypted Message: Meet me at 1PM Is this problem concerns with Arrays or strings? Mar 13 '07 #1
8 Replies

 Expert 2.5K+ P: 3,652 Probably both. Mar 13 '07 #2

 P: 40 Probably both. and probably its a multi-dimensional? Mar 13 '07 #3

 Expert 2.5K+ P: 3,652 Well, there will likely be a string: the message to be encrypted. Then you will probably have an array storing the characters you will be replacing the letters with - for instance, a char array of 26 elements with array[0] containing the character to replace A, array[1] containing the character to replace B, etc. Mar 13 '07 #4

 P: 40 Well, there will likely be a string: the message to be encrypted. Then you will probably have an array storing the characters you will be replacing the letters with - for instance, a char array of 26 elements with array[0] containing the character to replace A, array[1] containing the character to replace B, etc. ok, i'll give it a try... Mar 13 '07 #5

 P: 40 Well, there will likely be a string: the message to be encrypted. Then you will probably have an array storing the characters you will be replacing the letters with - for instance, a char array of 26 elements with array[0] containing the character to replace A, array[1] containing the character to replace B, etc. char name[5]; name [0] = 'A'; name [1] = 'E'; name [2] = 'I'; name [3] = 'O'; name [4] = 'U'; name [5] = 0; hello ganon, this is what you mean? Mar 13 '07 #6

 Expert 2.5K+ P: 3,652 How about something like this? Expand|Select|Wrap|Line Numbers char* replace = new char[26]; replace[0] = '*'; replace[1] = 'B'; replace[2] = 'C'; replace[3] = 'D'; replace[4] = '\$'; // etc. This would be the first 5 elements of an array switching * with A and \$ with E. Mar 13 '07 #7

 P: 40 How about something like this? Expand|Select|Wrap|Line Numbers char* replace = new char[26]; replace[0] = '*'; replace[1] = 'B'; replace[2] = 'C'; replace[3] = 'D'; replace[4] = '\$'; // etc. This would be the first 5 elements of an array switching * with A and \$ with E. thank you very much for the reply ganon, would like to ask another question...in every arrays, are you going to include the #include ? Mar 14 '07 #8

 Expert 2.5K+ P: 3,652 thank you very much for the reply ganon, would like to ask another question...in every arrays, are you going to include the #include ? I'm not sure I understand your question...You should #include because I think the strcmp method is included there. Mar 14 '07 #9