473,378 Members | 1,078 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

What kind of problem? C lang

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 1618
Ganon11
3,652 Expert 2GB
Probably both.
Mar 13 '07 #2
bitong
40
Probably both.
and probably its a multi-dimensional?
Mar 13 '07 #3
Ganon11
3,652 Expert 2GB
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
bitong
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
bitong
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
Ganon11
3,652 Expert 2GB
How about something like this?

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

Expand|Select|Wrap|Line Numbers
  1. char* replace = new char[26];
  2. replace[0] = '*';
  3. replace[1] = 'B';
  4. replace[2] = 'C';
  5. replace[3] = 'D';
  6. replace[4] = '$';
  7. // 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 <string.h>?
Mar 14 '07 #8
Ganon11
3,652 Expert 2GB
thank you very much for the reply ganon, would like to ask another question...in every arrays, are you going to include the #include <string.h>?
I'm not sure I understand your question...You should #include <string.h> because I think the strcmp method is included there.
Mar 14 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

65
by: perseus | last post by:
I think that everyone who told me that my question is irrelevant, in particular Mr. David White, is being absolutely ridiculous. Obviously, most of you up here behave like the owners of the C++...
24
by: Steven T. Hatton | last post by:
If I understand correctly, I have no assurance that I can determine the type of a simple class instance thrown as an exception unless I explicitly catch it by name. (non-derived classes having no...
9
by: Zero | last post by:
cc -c -o member.o member.c In file included from member.c:3: packet.h:55: two or more data types in declaration of `construct_request' packet.h:55: long, short, signed or unsigned invalid for...
5
by: Vladimir_petter | last post by:
Hello guys, Looks like this technology is comming along with VS2005. Anybody has an expirience of using it along with C++? What are the patterns? Thanks, Vladimir.
126
by: ramyach | last post by:
Hi friends, I need to write a parallel code in 'C' on the server that is running SGI Irix 6.5. This server supports MIPS Pro C compiler. I don't have any idea of parallel C languages. I looked...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
13
by: ANSHUL | last post by:
PLEASE PROVIDE ME D SOLUTION CODE FOR DIS PROBLEM. SELECTION SORT IS BASED ON D FOLLOWING IDEA: SELECTING D LARGEST ARRAY ELEMENT AND SWAPPING IT WITH THE LAST ARRAY ELEMENT LEAVES AN UNSORTED...
3
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
(I have posted this separately to comp.lang.c++ and comp.lang.c, reason being that I'd like a response from both communities, but I haven't cross-posted it because I think it's best not to mix C...
167
by: darren | last post by:
Hi I have to write a multi-threaded program. I decided to take an OO approach to it. I had the idea to wrap up all of the thread functions in a mix-in class called Threadable. Then when an...
3
by: vamsioracle | last post by:
Hi could someone explain me what kind of a code is this. CREATE OR REPLACE PACKAGE BODY APPS.FFP3613_01011951 AS /* Code generated by Oracle FastFormula - do not edit. Formula Name:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.