PLEASE WRITE THIS IN C   Please read the following: Has to have the two functions as stated below, and has to use pointer notation! Include two functions in your program, one which demonstrates the functionality using pointer notation and one which demonstrates the functionality using array indexing. The function prototypes are below: void copyArrayIndexWay(char * const newArray1, const char * const originalArray1);  void copyPointerWay(char *newArray2, const char *originalArray2); char originalArray1[] ="COMP10120"; char originalArray2[] = "COMP10110"; Include relevant print statements to explain the difference between the two functions and provide a nice output with the results..

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 1TF: Mark the following statements as true or false. A double type is an example of a simple data type....
icon
Related questions
Question

PLEASE WRITE THIS IN C

 

Please read the following: Has to have the two functions as stated below, and has to use pointer notation!

Include two functions in your program, one which demonstrates the functionality using pointer notation and one which demonstrates the functionality using array indexing. The function prototypes are below:

void copyArrayIndexWay(char * const newArray1, const char * const originalArray1); 

void copyPointerWay(char *newArray2, const char *originalArray2);

char originalArray1[] ="COMP10120";

char originalArray2[] = "COMP10110";

Include relevant print statements to explain the difference between the two functions and provide a nice output with the results..

 

Attached image of full question:

Array Copy
Write a Program in C to copy the contents of a one-dimensional character array
into another one-dimensional character array.
Include two functions in your program, one which demonstrates the functionality
using pointer notation and one which demonstrates the functionality using array
indexing. The function prototypes are below:
void copyArraylndexWay(char * const newArray1, const char * const
originalArray1);
void copyPointerWay(char *newArray2, const char *originalArray2);
char originalArray1[] ="COMP10120";
char originalArray2[] = "COMP10110";
Include relevant print statements to explain the difference between the two
functions and provide a nice output with the results..
Explain why the given function definition for copyPointerWay() may not work
well with a while loop. You can answer in the comments above the function in
your code.
Transcribed Image Text:Array Copy Write a Program in C to copy the contents of a one-dimensional character array into another one-dimensional character array. Include two functions in your program, one which demonstrates the functionality using pointer notation and one which demonstrates the functionality using array indexing. The function prototypes are below: void copyArraylndexWay(char * const newArray1, const char * const originalArray1); void copyPointerWay(char *newArray2, const char *originalArray2); char originalArray1[] ="COMP10120"; char originalArray2[] = "COMP10110"; Include relevant print statements to explain the difference between the two functions and provide a nice output with the results.. Explain why the given function definition for copyPointerWay() may not work well with a while loop. You can answer in the comments above the function in your code.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Concept of pointer parameter
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning