Simple program to detect the number of times a vowel occurs in a string
I agree mostly with @Yuri, but I feel that regex is an overkill here. Besides, as they say: "Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems". 

Check if a letter is a vowel

I'll begin with this function since it's at the core of your program:

// your code
bool vowelCount(char&amp; temp) 
{
    temp = toupper(temp);
    return (temp == 'A' || temp == 'E' || temp == 'I' || temp == 'O' || temp == 'U');
}


I didn't understand at first why you would pass the argument as a non-const reference. I realized only after that you relied on the inner toupper to store vowels in theMap as capital letters. That's a bad idea! One function should have one purpose and its purpose should be expressed clearly. In this case it assesses if the letter is a vowel, period.

So use a const reference instead or, even better, a copy of the character you take as an argument. A char is 1 byte, so taking it by reference or pointer never is an optimization and can even be a pessimization. 

The other thing I find sub-optimal in your code is the way you test if temp is a vowel. Firstly because there are better, faster ways to find a value in a range,  like binary_search, which is well known as well as available in the standard library (in &lt;algorithm&gt;). Secondly because the vowels' list isn't the same in all languages. For instance, in french, you would need to count 'y', 'à', 'â', 'é', 'è', 'ê', 'î', 'ô', 'ù', 'û', as well. That's why it might be more flexible and readable to keep the list separated from your code. 

So, I would have something like:

bool is_vowel(char c, const std::string&amp; sorted_vowel_list) {
    return std::binary_search(sorted_vowel_list.begin(),
                              sorted_vowel_list.end(),
                              std::toupper(c));
}


A Vowels' map

I'd then count the vowels into a map almost the way you do; I'd only use a range-based loop:

for (auto letter : input_string)
    if (is_vowel(letter))
        ++vowel_map[std::toupper(letter)];


If C++17 is available to you, you can then use "structured bindings" to read the map without referring to iterators:

for (auto [vowel, count] : vowel_map)
    std::cout &lt;&lt; "Vowel: " &lt;&lt; vowel &lt;&lt; " has " &lt;&lt; count &lt;&lt; " occurrences\n";