1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Encrypting User Given String

Discussion in 'C++' started by AnnRose, Apr 30, 2013.

  1. AnnRose

    AnnRose New Member

    Apr 30, 2013
    Likes Received:
    Trophy Points:
    Hi all. I am working on a program where a user first enters a string of 26 characters, they then choose the number of lines they'd like to use with a length of 40. I have it working as far as it encrypting a string that I enter into the code, but I don't know how to make it encrypt whatever input the user gives, nor do I know how make the program know how many lines they've chosen to use. I am a beginner/novice at C++, so any help would be greatly appreciated. Thank you in advance. This is the code I have so far:
    #include <iostream >
    using namespace std;
    void encrypt(char[]); 
    int main( )
    int userinput;    
    char string[ ] = "USeriNPut";
    cout << "The Decrypted String is: " << string << endl;
    cout << "The Encrypted String is: " << string << endl;
    return 0;
    void encrypt (char x[] ) 
    for( int i=0; x[i] != '\0'; ++i ) ++x[i];
    Last edited by a moderator: May 1, 2013

Share This Page