Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ and also check on gtest 1 of 5 Assignment_1_Spr2020.pdf 94.0% - Q - 0 X Q1: String Manipulation Write the implementation of the following

c++ and also check on gtest

image text in transcribedimage text in transcribed

1 of 5 Assignment_1_Spr2020.pdf 94.0% - Q - 0 X Q1: String Manipulation Write the implementation of the following functions: 1 int Strlen(char *81) 2 /*Returns the length of the string in number of characters. */ 3 1 1 char *Strcpy( char *sl, const char *s2) 2 /* Copies string s2 into array sl. The value of sl is returned. */ 3 { 1 char *Strncpy( char *sl, const char *82, int n) 2 /* Copies at most n characters of string s2 into array sl. 3 The value of sl is returned. */ 5 1 char *StrCat( char *sl, const char *82 ) 2 /* Appends string s2 to array sl. 3 The first character of s2 overwrites the terminating null character of sl. 4 The value of sl is returned. */ 6 ) 1 char *StrnCat( char *sl, const char *82, int n) 2 /* Appends at most n characters of string s2 to array sl. | 2 of 5 Assignment_1_Spr2020.pdf 94.0% - Q - 0 X 6 } 1 char *Strncat( char *sl, const char *82, int n) 2 /* Appends at most n characters of string s2 to array sl. 3 The first character of s2 overwrites the terminating null character o 4 The value of sl is returned. */ 6 1 int StrCmp( const char *sl, const char *82) 2 /* Compares the string sl with the string 2 3 The function returns 0, less than 0 or greater than 0 if sl is equal to, 4 less than or greater than s2, respectively. */ ... 6 ] 1 int Strncmp( const char *s1,const char *82, int n) 2 /* Compares up to n characters of the string sl with the string 2 3 The function returns 0. less than 0 or greater than 0 if sl is equal to 4 less than or greater than s2, respectively. */ 1 char **Str Tok char *s1,const char s2) 2 A call to StrTok breaks stringsl into ''tokens ! 3 (logical pieces such as words in a line of text ) separated by character 4 contained in char s2*/ 1 int StrFind (char *sl, char *s2) 2 /* Searches the string sl for the first occurrence of the string s2 3 and returns its starting index, if s2 not found returns - 1.*/ 1 char * SubStr (char *, int pos, int len) 2 /*This function returns a newly constructed string with its value initialized 3 to a copy of a substring of this variable. 4 The substring is the portion of the string that starts at character position 5 ''pos" and spans ''len' characters 6 (or until the end of the string, whichever comes first). */ 7 { 8 }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

Students also viewed these Databases questions

Question

5. Have you stressed the topics relevance to your audience?

Answered: 1 week ago