string_length

string_length
Turn-in directory05_string_length/
Files to turn instring_length.c
Allowed external functionsNone
Type of workFunction
  • Write a program which displays the alphabet in lowercase on standard output, starting from the character in variable start_char, ending with the character in stop_char, followed by a newline.
  • To help you get started, we will provide some code for you to copy/paste/edit. Make sure you understand every line before you hand it in!
  • You need to write a function that takes a C string as a parameter and returns the length of the string.
#include <stdio.h>

size_t string_length(const char* str);

int main()
{
    const char *hello = "Hello";
    size_t result = string_length(hello);
    printf("%d\n", result);
    return 0;
}

Example output:

$ ./a.out
5$