We are going over csting, pointers, and references. When writing my programs, I usually start off really basic then work my way up to completion. So what I have here is basically the skeleton and my logic of what the final product should somewhat look like. Again, I need to count the # of words which begin w/ an uppercase letter only.
Code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
const int max = 50;
char message [max], ch;
cout << "enter string \n";
cin.getline(message, max);
cout << "Msg is: \n" << message << endl;
for (int i=0; message[i] !='\0'; i++)
{
ch = message [i];
if (isupper (ch))
cout << "upper, the word is "<< ch << endl;
else if (islower (ch))
cout << "lower, the word is " << ch << endl;
}
return 0;
}
My main issue is trying to figure out when a word begins/ends.