Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using C++ Recall, a C-string is a null-terminated character array. The null characters preceding the null terminator (') are considered to be the characters of
Using C++
Recall, a C-string is a null-terminated character array. The null characters preceding the null terminator (') are considered to be the characters of the string. For example, the word "hello" would be stored in a char array of size six or bigger and the initial six characters would be 'h', 'e, . T o Any array elements after the null terminator are ignored. To get familiar with C-strings, write the following functions int getLength(const char w[l); // return the length of the c-string (excluding the null-terminator) void toUppercase (char w) II change any lowercase letters 'a' to 'z' to uppercase 'A' to '2* bool equal (const char v[], const char w[]); // return true if v and w contain the sane eharacters in same order, up to and including null terminators void copy (char destination const char sourcel): / copy source into destination including the null terminator. Assune the underying array tor destination is big enough to hold all the characters ot source. e.g.hlo"hello". I w only void removeLeadingSpaces (char II remove any leading spaces from contains spaces then a null terminator will be assigned to w char * getPointerToFirstNonSpace (const char w[]); // return a pointer to the first character that's not a space. o int countVowels (const char ) /1 return the number of vowels in w, where a vowel is 'a'','i', u(e're not counting 'y' as a vowel. bool comesBefore (const char v, const char wl) / return true if v comes before w in dictionary order. The neans compare character by character and return true or alse based on first nonmatching charaeter. I all character natch, return falsc Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started