hey I have to turn every letter from a string in capital letter. I don't know how many words there are nor if the first letter is capital or not. this algorithm is not working properly?? Any ideas why? Help please
include <iostream>
include <string.h>
include <fstream>
include <ctype.h>
using namespace std;
ifstream f("atestat.in");
ofstream g("atestat.out");
int main()
{unsigned int n,i,val=32;
char a[50];
f.getline(a,50);
n=strlen(angel);
//a if(a[1]>='a' && a[1]<='z')
cout<<a[1]-val;
else cout<<a[1];
for(i=2;i<=strlen(a);i++)
if((isalpha(a[i-1])==0)&& isalpha(a[i])==1)
cout<<a[i]-val;
else cout<<a[i];
f.close(); g.close(); return 0; }