logo CodeStepByStep logo

count_short_strings

Language/Type: C arrays string
Related Links:
Author: Cynthia Lee (on 2018/02/03)

Write a function named count_short_strings that accepts an array of strings (as char*[]) and the size of the array as an integer, and returns the number of strings in the array that have length less than or equal to 3. For example, if strs is defined as char* strs[] = {"moo", "boo", "ba", "mood"};, then the call count_short_strings(strs, 4) returns 3. You may assume that the size argument correctly represents the size of the array.

Function: Write a C function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.