Implement Robust Version C Library Function Strspn Name Size T Strspn Const Char S Const Q37052947

. () Implement a robust version of the C library functionstrspn(): Name: size t strspn(const char *s, const char*accept);

Description: The strspn() function calculates the length of theinitial segment of s which consists entirely of characters inaccept. Return Value: The strspn() function returns the number ofcharacters in the initial segment of s which consist only ofcharacters from accept, or −1 if it is unable to complete its task.Write robust code (even though the library version is fragile).That is, return −1 on failure, but do not crash. Think before youwrite anything.

size t strspn(const char *s, const char *accept){


Answer


#include<stdio.h>

// Function to

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.