January 5th, 2009, 09:41 PM
Alright, I am new to codeguru and I hope to help out a lot in the future, but heres my question. I am making a program that I am going to use for encryption and decryption.
Is there a way to have an array of 8-9 digit numbers being entered all at once? I would take any format that this would have to be done in. The reason I need to do it all at once is that the program is suppose to make encrypting and decrypting much easier. Each of those rather large numbers represents a letter.
Is there a format that I should use so that the user and put in sets of numbers like xxxxxxxx/xxxxxxxx/xxxxxxxx all in one line at one time and the program would spit back a word by converting the number to letters?
Thanks so much for your help. I hope this isn't too unclear to any of you.
January 5th, 2009, 10:06 PM
Re: cin arrays
1) Unless this is some type of school assignment, you are MUCH better off using either the CryptoAPI or the .NET Framework classes for encryption. Getting it right is VERY VERY VERY difficult.
2) To solve your specific problem, you can input a string. Spli it (STL or .NET) at a delimiter. Check the length of the resultant array to validate the "number of numbers" then validate the length of each item to validate the "number of digits", then convert from string to numeric values.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code
outside of [code] ... [/code]
tags. See here
* How NOT
to post a question here
* Of course you read this
carefully before you posted
* Need homework help? Read this first
January 6th, 2009, 11:57 AM
Re: cin arrays
Thanks so much. I'll work on it still. Its just a voluntary project so i'll quit if it gets very difficult.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!