User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







c:string.h:strspn

strspn

#include <stdlib.h>
size_t strspn(const char *str1, const char *str2);

strspn C Sourcecode Example

/* 
 * strspn example code
 * http://code-reference.com/c/string.h/strspn
 */
#include <stdio.h>
#include <string.h>
 
int main( void )
{
    const char string[] = "the answer is 42";
    int pos = strspn(string, "the answer = 42");
    printf("different char at position :%d\n",pos+1);
    return 0;
}

output of strspn c example

  different char at position :12
advertising
c/string.h/strspn.txt · Last modified: 2013/02/17 02:13 by Daniel Gohlke

Impressum Datenschutz