#include<iostream>
#include<string>
using namespace std;
void main()
{
char *inputString;
inputString=new char[];
cout<<"Enter your string:"<<endl;
cin>>inputString;
//int stringLength=inputString.length();
int stringLength=strlen(inputString);
inputString=new char[stringLength];
cout<<stringLength<<endl;
for(int i=0; i<stringLength; i++)
{
if(inputString[i]>='a' && inputString[i]<='z')
{
if (inputString[i] != ' ')
{
inputString[i]=toupper(inputString[i]);
cout<<inputString[i];
}
else
cout<<inputString[i];
}
else
cout<<inputString[i];
}
cout<<endl;
}
First it takes only the first word, and second I feel there's a big mess with the dynamic arrays!
yes I'm a beginner :$ any help pointing out my mistakes?