#include <iostream>
#include <string.h>
#include <ctype.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 Guy i'm new to C++ programming i have a program to encrypt a string(sentence), i need to use a function but dont know how to go about implementing it. after i encrypt the sentence i want to remove the space from it, and then use another function for removing the vowels. can i use this code in the function for removing spaces.
for(i=0;i<=x-1;i++)
{
if(cipher[i]!=' ')
{
cout<<cipher[i]<< endl; // removing spaces from string(sentence)
}
thanks in advanced guys hope you can help.