icp/oer/courses/c-basics/sections/11-strings/04-counting/program.c

11 lines
301 B
C

#include <stdio.h>
// Returns the number of occurences of c in str
// TODO: Implement a count function that works with the call below
int main(int argc, const char *argv[])
{
const char text[] = "Goodbye World!";
int os = count(text, 'o');
printf("Number of o's: %d", os);
return 0;
}