Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++: Fulfilling the requirements: //stringPkg.h//A library of ASCIIZ string functions.//All functions in this library manipulate character arrays//whose values are sequences of characters (string-values)//utilizing the ASCIIZ
C++:
Fulfilling the requirements:
//stringPkg.h//A library of ASCIIZ string functions.//All functions in this library manipulate character arrays//whose values are sequences of characters (string-values)//utilizing the ASCIIZ format.//----------------//Return length of a string, length > =0.//Length is a count of the characters in the string-value, /ot including the null at the end.//An empty string (" ") has length theta. int stringLength (const char s[]);//---------------//Copy string src to string dest void string Copy (char dest [], const int destBuffsize, const char src []);//-----------//Concatenate string t to end of string dest void string Concatenate (char dest [], const int destBuffsize, const char t[]);//---------------//Retrieve character from string s[position] Position must be between 0 and (stringLength-1).//Return 0 if position is out of range char stringGetchar (const char s[], const int position);//---------------//Find ch in string s starting a the "startpos" array location.//startpos must be non-negative and less than the string length.//Return the 'found' position: 0 - (stringLength-1)//Return -1 if ch not found in s. int stringFindchar (const char s[], const char ch, const int startpos = 0);//---------------//Set resultString [] to a string value that is a copy of//a specified substring of original string s.//If specified start position is not located within the string s, //then set resultString to the empty string (" ").//If specified len the length of s//then set resultstring to the longest possible substring. Void stringSubstring(char resultString[], /ew string buffer const int resultBuffSize, //result array biffer size const int s[], //starting position of substring within s const int len = -1);//length of substring within s//len 0 if s > t int stringCompare(const cher s[], const char t[])
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started