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:
Code:
#include <iostream >
using namespace std;
void encrypt(char[]); 


int main( )
{
int userinput;    

char string[ ] = "USeriNPut";


cout << "The Decrypted String is: " << string << endl;
encrypt(string);

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 shabbir; 1May2013 at 09:09.. Reason: Code blocks