Design Pattern Examples
Overview of object-oriented design patterns
titlecase.c File Reference

Implementation of the titlecase() function, for making a word lowercase with the first letter uppercase. More...

#include <ctype.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <memory.h>
#include <string.h>
#include "titlecase.h"
Include dependency graph for titlecase.c:

Go to the source code of this file.

Functions

char * titlecase (const char *s)
 Convert the first word (or only word) in the given string to lowercase then make the first letter uppercase. It does not touch any of the other words after the first.
 

Detailed Description

Implementation of the titlecase() function, for making a word lowercase with the first letter uppercase.

Definition in file titlecase.c.

Function Documentation

◆ titlecase()

char * titlecase ( const char *  s)

Convert the first word (or only word) in the given string to lowercase then make the first letter uppercase. It does not touch any of the other words after the first.

Note that this is not locale-sensitive.

Parameters
sA string to work on.
Returns
Returns a pointer to newly allocated buffer containing the modified string. Call free() on the pointer when done with it. Returns NULL if an out of memory condition occurs.

Definition at line 15 of file titlecase.c.

Referenced by Interpreter_Interpret().