logo CodeStepByStep logo

countShortStrings

Language/Type: C arrays strings
Author: Cynthia Lee (on 2016/10/02)

Write a function named countShortStrings 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 countShortStrings(strs, 4) returns 3. You may assume that the size argument correctly represents the size of the array.

Type your C solution code here:


This is a function problem. Write a C function as described. Do not write a complete program; just the function(s) above.

You must log in before you can solve this problem.


Log In

Need help?

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.

© Marty Stepp, all rights reserved.