Count Alphabetic Letter
Lesson 11 of 18 in Coddy's Functions in C++: Building Your Own Functions course.
Challenge
EasyWrite a function to count characters in a given string.
The function count_characters takes a string (arrays of characters), checks the characters, and counts them.
Example:
- If the input is
<strong>“Coddy2024”</strong> - The output will be
<strong>5</strong>.
Try it yourself
#include <iostream>
#include <string>
using namespace std;
int countCharacters(string str) {
}All lessons in Functions in C++: Building Your Own Functions
1Introduction
Introduction2Beginner-level function
Repeat a StringReverse a StringMax ValueFill stringCenter TextFormat TextMath Operation3Intermediate-level functions
Compare two StringsSwap CasesCount Alphabetic LetterReplace in ArrayExtracts Integers Generate CharactersDeletes Specific Index