cin arrays
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: cin arrays

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    2

    Question cin arrays

    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.

  2. #2
    Join Date
    Mar 2002
    Location
    NY, USA
    Posts
    12,097

    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!)
    2008, 2009
    In theory, there is no difference between theory and paractice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Jan 2009
    Posts
    2

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center