C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 8, Problem 8.28E
Program Plan Intro

Program plan:

  1. str1,str2,str3,str4 variablesare used for inputs
  2. char *strcpyptr(char *dest, const char *src) function stores string array reference in pointer variables and copy srcto deststring using pointer arithmetic and return the copied string.
  3. char *strcpyarr(char dest[], const char src[]) function stores string array reference in two array variables and copy srcto deststring using array index and return the copied string.
  4. char *strcatarr(char src[], char dest[])) function stores string array reference in pointer variables and perform concatenation using srcanddeststrings using pointer arithmetic and return the resultant string.
  5. char *strcatptr(char *src, const char *dest) function stores string array reference in two array variables and perform concatenation using srcand dest using array index and return the resultant string.

Program description:

The main purpose of the program is to demonstrate the working of built-in string function strcat() and strcpy() by writing the two versions of each function. One version of each uses the pointer arithmetic to copy and concat the strings. Second version of each uses array index to copy and concat the strings.

Blurred answer
Students have asked these similar questions
how to know the weight to data and data to weight also weight by infomraion gain in rapid miner , between this flow diagram retrieve then selecte attrbuite then set role and split data and decision tree and apply model and peformance ,please show how the operators should be connected:
using rapid miner how to creat decison trea for all attribute and another one with delete one or more of them also how i know the weight of each attribute and what that mean in impact the result
Q.1. Architecture performance [10 marks] Answer A certain microprocessor requires either 2, 4, or 6 machine cycles to perform various operations. ⚫ (40+g+f)% require 2 machine cycles, ⚫ (30-g) % require 4 machine cycles, and ⚫ (30-f)% require 6 machine cycles. (a) What is the average number of machine cycles per instruction for this microprocessor? Answer (b) What is the clock rate (machine cycles per second) required for this microprocessor to be a "1000 MIPS" processor? Answer (c) Suppose that 35% of the instructions require retrieving an operand from memory which needs an extra 8 machine cycles. What is the average number of machine cycles per instruction, including the instructions that fetch operands from memory?
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning