int main(void){
	char test[1000] = "There is no Free Lunch";

	upper_to_lower(test);
	printf("%s\n",test);
	lower_to_upper(test);
	printf("%s\n",test);

	return 0;
}
示例#2
0
void str_to_title (unsigned char *d, unsigned char *s, int4 len)
{
	boolean_t       up;
	unsigned        char *c, *top;

	assert(0 <= len);
	if (0 >= len)
		return;
	upper_to_lower(d, s, len);
	c = d;
	for (top = c + len, up = TRUE; c < top; c++)
	{
		if (' ' == *c)
		{
			up = TRUE;
			continue;
		}
		if (up && (97 <= *c) && (122 >= *c))
		{
			*c = lower_to_upper_table[*c];
			up = FALSE;
		}
	}
}