Middleware, development tools, realtime operating system
software and services for superior embedded design


Home
QNX Community Resources
Developer Support
QNX Documentation Library
QNX Developer Support

QNX Developer Support

QNX Software Systems
Developer Resources
Blogs
Board support packages
Foundry27 projects
Forums
Hardware support listing
Online video tutorials
Product documentation
Technical Articles

[Previous] [Contents] [Index] [Next]

index()

Find a character in a string

Synopsis:

#include <strings.h>

char* index( const char* s, 
             int c );

Arguments:

s
The string you want to search. This string must end with a null (\0) character. The null character is considered to be part of the string.
c
The character you're looking for.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The index() function returns a pointer to the first occurrence of the character c in the string s.

Returns:

A pointer to the character, or NULL if the character doesn't occur in the string.

Classification:

POSIX 1003.1 XSI

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

rindex(), strchr(), strrchr()


[Previous] [Contents] [Index] [Next]