#include <iostream>
#include <string.h>
#include <ctype.h>
using namespace std;
void RemoveSpaces(char *str);
void RemoveVowels(char *str);
int main()
{
char clear[256];
char cipher[256];
int x,i;
int opt;
cout<<"Encryption (1) 0r Decryption (2):"<<endl;
cin>>opt;
cin.ignore();
if(opt==1)
{
cout<<" Enter a string(sentence):";
cin.getline(clear,sizeof(clear));
RemoveSpaces(clear);
x = strlen(clear);
for(i=0;i<=x-1;i++)
{
cipher[i] = clear[i]+3;
}
cipher[x] = '\0';
cout<<" Encrypted:"<< cipher << endl;
}
for(i=0; i<=x-1; i++)
{
if (isspace(clear[i]))
{
cipher[i] = clear[i];
}
else
{
cipher[i] = clear[i]+3;
}
cout<<cipher[i]<<endl;
RemoveVowels(clear);
}
cin.get();
return 0;
}
void RemoveSpaces(char *str)
{
int i = 0;
int length = strlen(str);
while(i < length)
{
if( isspace(str[i] ))
{
memmove(&str[i], &str[i+1], length-1);
--length;
}
else
++i;
}
}
void RemoveVowels(char *str)
{
int i = 0;
int lenght = strlen(str);
for(i=0;i<=-lenght;i++)
{
if (str[i]=='a' || str[i]=='e' || str[i]=='i' || str[i]=='o' || str[i]=='u' || str[i]=='A' || str[i]=='E' || str[i]=='I' || str[i]=='O' || str[i]=='U') {
str[i]=' ';
}
}
//removing Vowels
}
Hey guys I'm trying to remove vowels from a string from inside the function. i just cant figure it out. any advice and tips are very welcome.thanks again