Hi there.
I'm fairly new at using C++ and I have to do program on this summer course I'm doing. Trouble is, despite what I have read through and been taught, I just can't get my head around a few things regarding this program I need to make within three days.
Here's the breif I have:
Write a program that asks the user to input a word, or series of characters. The program should determine the length of the users character string, and count the number of occurrences of each letter. This information should then be output to the screen.
The program should store the user input in an appropriate structure before determining length and counting occurrences of each letter.
And here's the code I've come up with so far:
using namespace std;
#include <iostream>
#include <string>
int main()
{
string userwd;
cout << "Hello.\nPlease input a word to analyse: ";
cin >> userwd;
cout << "Your word is: " << userwd << ".\n";
int letters;
count userwd;
int count[letters];
system("PAUSE");
return 0;
}
I know it might seem stupid, but I'm not a logical thinker. If there's any help you can offer, it'll be greatly appreciated.
Many thanks,
Dr Stupid