|
Description
This example uses the
strlen function to find out how many
characters are in a string .
Code
#include <stdio.h>
#include <string.h>
int main()
{
char title[] = "Programmers help
: C section.";
int characters;
/*get the amount of characters*/
characters = strlen(title);
printf("%s has %d characters.\n",
title,characters);
return 0;
}
Information
tested using LCC Win
32
|