[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


strlen

Compute the length of a character array.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <string.h>
size_t strlen(const char *s);
Parameters:

Parameters for this facility are:

s1  
const char *  
The string to evaluate  

Remark:

The strlen() function computes the number of characters in a null terminated character array pointed to by s. The null character ('\0') is not added to the character count.

Return:

strlen() returns the number of characters in a character array not including the terminating null character.

Example of strlen() usage.:
#include <string.h>
#include <stdio.h>

int main(void)
{
	static char s[] = "antidisestablishmentarianism";

	printf("The length of %s is %ld.\n", s, strlen(s));

	return 0;
}

Output:
The length of antidisestablishmentarianism is 28.


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000