#include <iostream>
#include <string.h>
using namespace std;
int main()
{
char clear[200];
char cipher[200];
int x,i;
cout<<" Enter a string:";
cin.getline(clear,sizeof(clear));
x = strlen(clear);
for(i=0;i<=x-1;i++)
{
cipher[i] = clear[i]+3;
}
cipher[x] = '\0';
cout<<" Encrypted:" << cipher << endl;
system("pause");
return 0;
}
Hey guys hope someone could help me, as i'm new to programming. i need to encrypt a full sentence. with my program above it will encrypt but as soon as it reaches a space it will output only one word and not the full sentence. how can i encrypt the full sentence.
thanks guys hope you can help. im guessing as soon the program see's a spaces by default its see's '\0' is this correct.