Write a recursive function, vowels, that returns the number of vowels in a string (character array).no global variables are allowed ??
leenana
0
Newbie Poster
Recommended Answers
Jump to PostAnd your code?
Jump to PostHere's a big hint which counts the characters.
#include <iostream> unsigned long vowels(char ca[], unsigned long v_num) { if ( ca[0] == '\0' ) return v_num; vowels(++ca, ++v_num); } int main(int argc, char** argv) { char str[] = "This is a string to check for vowels"; std::cout …
All 5 Replies
richieking
44
Master Poster
leenana
0
Newbie Poster
gerard4143
371
Nearly a Posting Maven
leenana
0
Newbie Poster
gerard4143
371
Nearly a Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.