Use c-strings without using the c-string library

Assignment Help C/C++ Programming
Reference no: EM13159796

write a program that implementd and test the following functions for use C-strings without using the c-string libaray ( that is, you re NOT ALLOWED to use #include <cstring> in this   program):

int strcompare(const   char *s1, const   char *s2);
The   strcompare function   performs   a   comparison   of   s1   to   s2.   It   starts   with   the   first   character   in   each   string  
and   continues   with   subsequent   characters   until   the   corresponding   characters   differ   or   until   the   end   of   the  
strings   is   reached.   strcompare   returns   a   value   that   is:  
  
< 0       if   s1   is   less   than   s2,  
== 0       if   s1   is   the   same   as   s2,   or  
> 0       if   s1   is   greater   than   s2.
  
More   precisely,   if   the   strings   differ,   the   value   of   the   first   nonmatching   character   in   s2   subtracted   from   the  
corresponding   character   in   s1   is   returned.     

unsigned long strlength(const char *str);
The strlength   function   calculates   the   length   of   str.   Returns   the   number   of   characters   in   str,   not   counting  
the   terminating   null   character

Test   Run:
Enter string 1: cats rule
Enter string 2: DOGS DROOL
string 1 is 9 characters long.
string 2 is 10 characters long.
string 2 lexicographically comes before string 1.

 

 

Reference no: EM13159796

Questions Cloud

Which of the following is not a feature of epithelium : Which of the following is NOT a feature of epithelium?
Operating system that supports a one-to-one relationship : Given an operating system that supports a one-to-one relationship between user-level threads and kernel-level threads and allows one or more threads from a process to issue blocking system calls while other threads (within that process) continue to r..
It should have an if statement : The following are hints given: It should have an if statement. This add method determines what number greater than or less than the other number, than it adds the positive or negative. I think this should be a private method.
Write a regression model : Describe the effect of this change in units on the estimated regression coefficients and their standard errors, t and F-statistics, p-values, and the value of R 2 .
Use c-strings without using the c-string library : write a program that implementd and test the following functions for use C-strings without using the c-string libaray  ( that is, you re NOT ALLOWED to use #include in this   program):
Bond ammortization schedule using effective interest method : Prepare journal entry to record the issuance of the bonds and the related bond issue costs incurred January 1, 2009. Prepare a bond ammortization schedule up to and including January 1, 2013 using effective interest method
Boolean variable called wantstoppings : After reading the input character, the program shall assign a value to a Boolean variable called  wantsToppings ( true  for a customer who wants toppings,  false  for a customer who does not).
Report of client-s request by summarizing research : Write a 1,050- to 1,400-word paper that addresses your client's request by summarizing research from the FASB Accounting Standards Codification website and other sources.
What is an allele : What is the krebs cycle and where does it take place andwhat does it do?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  File system with login authentication

Implement a simple file system with login authentication and access control - Construct a hash/salt/shadow based user/password creation system.

  Object-oriented systems is the concept of object

At the heart of all object-oriented systems is the concept of an object. Simply stated, an object is a set of related characteristics and their associated actions.

  Program to translates letter grade into number grade

In C++ (should be able to compile in Visual Studio 2010): Write a program to translates letter grade into number grade. Letter grades are A,B,C,D and F, possibly followed by a + or -.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Implementation of sorting technique

Implementation of sorting technique

  Write a function that takes an integer array

1. Write a function that takes an integer array and the array's size as parameters. The function will check if the array is sorted. If it is, it will return a 1. If it is not sorted it will return 0. The function should not  sort the array.

  Write a c++ program containing a linked list of 10 integer

Write a C++ program containing a linked list of 10 integer numbers. Have the program display the numbers in the list.

  Iterative programming problem solving approaches

Write a recursive function void reverse ( ) that reverse a sentence

  Definitions of the class circularlinkedlist

Write the definitions of the class circularLinkedList and its member functions. (You may assume that the elements of the circular linked list are in ascending order.)

  Create class has three pieces of information as data members

Create a class called Date in C++ that includes three pieces of information as data members: month (type int), day (type int) and yaer (type int).

  Prepare an arbitrary sinusoidal waveform

Create a program to compute the derivative of an arbitrary input function, with arbitrary duration and arbitrary limits

  Design a class named employeerecord

Design a class named EmployeeRecord that holds an employee's ID number, name, and payrate. Include mutator methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code that

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd