SlideShare a Scribd company logo
1 of 1
Download to read offline
Write a program that initializes an array-of-double and then copies the contents of the array
into two other arrays. (All three arrays should be declared in the main program.) To make
the first copy, use a function with array notation. To make the second copy, use a function
with pointer notation and pointer incrementing. Have each Function take as arguments the
name of the target array and the number of elements to be copied. That is, the function calls
would look like this, given the following declarations:
double source[5] = {1.1, 2.2, 3.3, 4.4, 5.5};
double target[5];
double target[5];
copy_arr(source, target1, 5);
copy_ptr(source, target1, 5);
Design and test a function that searches the string specified by the first function parameter
for the first occurrence of a character specified by the second function parameter. Have the
function return a pointer to the character if successful, and a null if the character is not
found in the string. (This duplicates the way that the library strchr() function works.) Test
the function in a complete program that uses a loop to provide input values for feeding to
the function.
Note that if the function does not find the character, it should return a NULL pointer, not a
pointer to a NULL character.

More Related Content

What's hot (20)

Basic information of function in cpu
Basic information of function in cpuBasic information of function in cpu
Basic information of function in cpu
 
Header files in c
Header files in cHeader files in c
Header files in c
 
Python list functions
Python list functionsPython list functions
Python list functions
 
user defined function
user defined functionuser defined function
user defined function
 
C language presentation
C language presentationC language presentation
C language presentation
 
predefined and user defined functions
predefined and user defined functionspredefined and user defined functions
predefined and user defined functions
 
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 Data Structures - Lecture 9 [Stack & Queue using Linked List] Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 
Python functions
Python functionsPython functions
Python functions
 
Program activation records
Program activation recordsProgram activation records
Program activation records
 
Pointer basics
Pointer basicsPointer basics
Pointer basics
 
Stack and heap
Stack and heapStack and heap
Stack and heap
 
Fda unit 1 lec 1
Fda unit 1 lec  1Fda unit 1 lec  1
Fda unit 1 lec 1
 
Function in C Language
Function in C Language Function in C Language
Function in C Language
 
Python algorithm
Python algorithmPython algorithm
Python algorithm
 
Recursion in c++
Recursion in c++Recursion in c++
Recursion in c++
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
User Defined Functions
User Defined FunctionsUser Defined Functions
User Defined Functions
 
Function & Recursion
Function & RecursionFunction & Recursion
Function & Recursion
 
Stack Data Structure
Stack Data StructureStack Data Structure
Stack Data Structure
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 

Similar to Write a program that initializes an array - of - double and then copies the contents of the array i

Lewis jssap3 e_labman02
Lewis jssap3 e_labman02Lewis jssap3 e_labman02
Lewis jssap3 e_labman02auswhit
 
Amit user defined functions xi (2)
Amit  user defined functions xi (2)Amit  user defined functions xi (2)
Amit user defined functions xi (2)Arpit Meena
 
Functions in C++
Functions in C++Functions in C++
Functions in C++home
 
Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2Prerna Sharma
 
Unit_5Functionspptx__2022_12_27_10_47_17 (1).pptx
Unit_5Functionspptx__2022_12_27_10_47_17 (1).pptxUnit_5Functionspptx__2022_12_27_10_47_17 (1).pptx
Unit_5Functionspptx__2022_12_27_10_47_17 (1).pptxvekariyakashyap
 
Functions in c++, presentation, short and sweet presentation, and details of ...
Functions in c++, presentation, short and sweet presentation, and details of ...Functions in c++, presentation, short and sweet presentation, and details of ...
Functions in c++, presentation, short and sweet presentation, and details of ...Sar
 
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfUSER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfSowmyaJyothi3
 
Chapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer ScienceChapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer ScienceKrithikaTM
 
Functions in Python Syntax and working .
Functions in Python Syntax and working .Functions in Python Syntax and working .
Functions in Python Syntax and working .tarunsharmaug23
 
Tackling repetitive tasks with serial or parallel programming in R
Tackling repetitive tasks with serial or parallel programming in RTackling repetitive tasks with serial or parallel programming in R
Tackling repetitive tasks with serial or parallel programming in RLun-Hsien Chang
 

Similar to Write a program that initializes an array - of - double and then copies the contents of the array i (20)

C language 3
C language 3C language 3
C language 3
 
qb unit2 solve eem201.pdf
qb unit2 solve eem201.pdfqb unit2 solve eem201.pdf
qb unit2 solve eem201.pdf
 
cp05.pptx
cp05.pptxcp05.pptx
cp05.pptx
 
Lewis jssap3 e_labman02
Lewis jssap3 e_labman02Lewis jssap3 e_labman02
Lewis jssap3 e_labman02
 
Functions
FunctionsFunctions
Functions
 
Amit user defined functions xi (2)
Amit  user defined functions xi (2)Amit  user defined functions xi (2)
Amit user defined functions xi (2)
 
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
 
Lecture 08.pptx
Lecture 08.pptxLecture 08.pptx
Lecture 08.pptx
 
Function
FunctionFunction
Function
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Inroduction to r
Inroduction to rInroduction to r
Inroduction to r
 
Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2
 
Function
FunctionFunction
Function
 
Unit_5Functionspptx__2022_12_27_10_47_17 (1).pptx
Unit_5Functionspptx__2022_12_27_10_47_17 (1).pptxUnit_5Functionspptx__2022_12_27_10_47_17 (1).pptx
Unit_5Functionspptx__2022_12_27_10_47_17 (1).pptx
 
Functions in c++, presentation, short and sweet presentation, and details of ...
Functions in c++, presentation, short and sweet presentation, and details of ...Functions in c++, presentation, short and sweet presentation, and details of ...
Functions in c++, presentation, short and sweet presentation, and details of ...
 
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfUSER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
 
Chapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer ScienceChapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer Science
 
Functions in Python Syntax and working .
Functions in Python Syntax and working .Functions in Python Syntax and working .
Functions in Python Syntax and working .
 
Functions
FunctionsFunctions
Functions
 
Tackling repetitive tasks with serial or parallel programming in R
Tackling repetitive tasks with serial or parallel programming in RTackling repetitive tasks with serial or parallel programming in R
Tackling repetitive tasks with serial or parallel programming in R
 

More from licservernoida

Biol 1322 crn (course number)name datebiol 1322 crn (c
Biol 1322   crn (course number)name datebiol 1322 crn (cBiol 1322   crn (course number)name datebiol 1322 crn (c
Biol 1322 crn (course number)name datebiol 1322 crn (clicservernoida
 
Being in the nursing field you will come across many different e
Being in the nursing field you will come across many different eBeing in the nursing field you will come across many different e
Being in the nursing field you will come across many different elicservernoida
 
Assume that chocolate bliss, the fictitious company in the cours
Assume that chocolate bliss, the fictitious company in the coursAssume that chocolate bliss, the fictitious company in the cours
Assume that chocolate bliss, the fictitious company in the courslicservernoida
 
Assignment in this assignment you will start on proposing ideas
Assignment in this assignment you will start on proposing ideasAssignment in this assignment you will start on proposing ideas
Assignment in this assignment you will start on proposing ideaslicservernoida
 
Assignment 1-case study assignment questionplease re
Assignment 1-case study assignment questionplease reAssignment 1-case study assignment questionplease re
Assignment 1-case study assignment questionplease relicservernoida
 
Assignment 1-case study assignment question
Assignment 1-case study assignment question       Assignment 1-case study assignment question
Assignment 1-case study assignment question licservernoida
 
Assignment strategic planning and financial management pre
Assignment strategic planning and financial management preAssignment strategic planning and financial management pre
Assignment strategic planning and financial management prelicservernoida
 
Assignment 1 supply and demand videoafter reviewing the video you
Assignment 1 supply and demand videoafter reviewing the video youAssignment 1 supply and demand videoafter reviewing the video you
Assignment 1 supply and demand videoafter reviewing the video youlicservernoida
 
Assignment 1 executive memo you are the ceo of a healthcare or
Assignment 1 executive memo you are the ceo of a healthcare orAssignment 1 executive memo you are the ceo of a healthcare or
Assignment 1 executive memo you are the ceo of a healthcare orlicservernoida
 
Assignment 1 (to be submitted through the assignment submiss
Assignment 1 (to be submitted through the assignment submissAssignment 1 (to be submitted through the assignment submiss
Assignment 1 (to be submitted through the assignment submisslicservernoida
 
6 the constitution and the new republic· framing a new governme
6 the constitution and the new republic· framing a new governme6 the constitution and the new republic· framing a new governme
6 the constitution and the new republic· framing a new governmelicservernoida
 
2 the dental hygienists guide tonutritional care
2 the dental hygienists guide tonutritional care2 the dental hygienists guide tonutritional care
2 the dental hygienists guide tonutritional carelicservernoida
 
2 healthcares vulnerability to ransomware attacks by abhilas
2 healthcares vulnerability to ransomware attacks by abhilas2 healthcares vulnerability to ransomware attacks by abhilas
2 healthcares vulnerability to ransomware attacks by abhilaslicservernoida
 
1 tenea lewissocw 6301methodological approach
1 tenea lewissocw 6301methodological approach1 tenea lewissocw 6301methodological approach
1 tenea lewissocw 6301methodological approachlicservernoida
 
1 solitary confinementolen jessiedepartment name, p
1 solitary confinementolen jessiedepartment name, p1 solitary confinementolen jessiedepartment name, p
1 solitary confinementolen jessiedepartment name, plicservernoida
 
1.)what actions and behaviors might a health leader perform to proac
1.)what actions and behaviors might a health leader perform to proac1.)what actions and behaviors might a health leader perform to proac
1.)what actions and behaviors might a health leader perform to proaclicservernoida
 
1.  a family is gathered around in the icu waiting room to monitor t
1.  a family is gathered around in the icu waiting room to monitor t1.  a family is gathered around in the icu waiting room to monitor t
1.  a family is gathered around in the icu waiting room to monitor tlicservernoida
 
1. the writer has used a letter ing system to describe the
1. the writer has used a letter ing system to  describe the 1. the writer has used a letter ing system to  describe the
1. the writer has used a letter ing system to describe the licservernoida
 
1. for this assignment, i want you to pick a popular song (aim to
1. for this assignment, i want you to pick a popular song (aim to 1. for this assignment, i want you to pick a popular song (aim to
1. for this assignment, i want you to pick a popular song (aim to licservernoida
 
1. considering the information provided in the case study, do you
1. considering the information provided in the case study, do you 1. considering the information provided in the case study, do you
1. considering the information provided in the case study, do you licservernoida
 

More from licservernoida (20)

Biol 1322 crn (course number)name datebiol 1322 crn (c
Biol 1322   crn (course number)name datebiol 1322 crn (cBiol 1322   crn (course number)name datebiol 1322 crn (c
Biol 1322 crn (course number)name datebiol 1322 crn (c
 
Being in the nursing field you will come across many different e
Being in the nursing field you will come across many different eBeing in the nursing field you will come across many different e
Being in the nursing field you will come across many different e
 
Assume that chocolate bliss, the fictitious company in the cours
Assume that chocolate bliss, the fictitious company in the coursAssume that chocolate bliss, the fictitious company in the cours
Assume that chocolate bliss, the fictitious company in the cours
 
Assignment in this assignment you will start on proposing ideas
Assignment in this assignment you will start on proposing ideasAssignment in this assignment you will start on proposing ideas
Assignment in this assignment you will start on proposing ideas
 
Assignment 1-case study assignment questionplease re
Assignment 1-case study assignment questionplease reAssignment 1-case study assignment questionplease re
Assignment 1-case study assignment questionplease re
 
Assignment 1-case study assignment question
Assignment 1-case study assignment question       Assignment 1-case study assignment question
Assignment 1-case study assignment question
 
Assignment strategic planning and financial management pre
Assignment strategic planning and financial management preAssignment strategic planning and financial management pre
Assignment strategic planning and financial management pre
 
Assignment 1 supply and demand videoafter reviewing the video you
Assignment 1 supply and demand videoafter reviewing the video youAssignment 1 supply and demand videoafter reviewing the video you
Assignment 1 supply and demand videoafter reviewing the video you
 
Assignment 1 executive memo you are the ceo of a healthcare or
Assignment 1 executive memo you are the ceo of a healthcare orAssignment 1 executive memo you are the ceo of a healthcare or
Assignment 1 executive memo you are the ceo of a healthcare or
 
Assignment 1 (to be submitted through the assignment submiss
Assignment 1 (to be submitted through the assignment submissAssignment 1 (to be submitted through the assignment submiss
Assignment 1 (to be submitted through the assignment submiss
 
6 the constitution and the new republic· framing a new governme
6 the constitution and the new republic· framing a new governme6 the constitution and the new republic· framing a new governme
6 the constitution and the new republic· framing a new governme
 
2 the dental hygienists guide tonutritional care
2 the dental hygienists guide tonutritional care2 the dental hygienists guide tonutritional care
2 the dental hygienists guide tonutritional care
 
2 healthcares vulnerability to ransomware attacks by abhilas
2 healthcares vulnerability to ransomware attacks by abhilas2 healthcares vulnerability to ransomware attacks by abhilas
2 healthcares vulnerability to ransomware attacks by abhilas
 
1 tenea lewissocw 6301methodological approach
1 tenea lewissocw 6301methodological approach1 tenea lewissocw 6301methodological approach
1 tenea lewissocw 6301methodological approach
 
1 solitary confinementolen jessiedepartment name, p
1 solitary confinementolen jessiedepartment name, p1 solitary confinementolen jessiedepartment name, p
1 solitary confinementolen jessiedepartment name, p
 
1.)what actions and behaviors might a health leader perform to proac
1.)what actions and behaviors might a health leader perform to proac1.)what actions and behaviors might a health leader perform to proac
1.)what actions and behaviors might a health leader perform to proac
 
1.  a family is gathered around in the icu waiting room to monitor t
1.  a family is gathered around in the icu waiting room to monitor t1.  a family is gathered around in the icu waiting room to monitor t
1.  a family is gathered around in the icu waiting room to monitor t
 
1. the writer has used a letter ing system to describe the
1. the writer has used a letter ing system to  describe the 1. the writer has used a letter ing system to  describe the
1. the writer has used a letter ing system to describe the
 
1. for this assignment, i want you to pick a popular song (aim to
1. for this assignment, i want you to pick a popular song (aim to 1. for this assignment, i want you to pick a popular song (aim to
1. for this assignment, i want you to pick a popular song (aim to
 
1. considering the information provided in the case study, do you
1. considering the information provided in the case study, do you 1. considering the information provided in the case study, do you
1. considering the information provided in the case study, do you
 

Recently uploaded

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 

Recently uploaded (20)

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 

Write a program that initializes an array - of - double and then copies the contents of the array i

  • 1. Write a program that initializes an array-of-double and then copies the contents of the array into two other arrays. (All three arrays should be declared in the main program.) To make the first copy, use a function with array notation. To make the second copy, use a function with pointer notation and pointer incrementing. Have each Function take as arguments the name of the target array and the number of elements to be copied. That is, the function calls would look like this, given the following declarations: double source[5] = {1.1, 2.2, 3.3, 4.4, 5.5}; double target[5]; double target[5]; copy_arr(source, target1, 5); copy_ptr(source, target1, 5); Design and test a function that searches the string specified by the first function parameter for the first occurrence of a character specified by the second function parameter. Have the function return a pointer to the character if successful, and a null if the character is not found in the string. (This duplicates the way that the library strchr() function works.) Test the function in a complete program that uses a loop to provide input values for feeding to the function. Note that if the function does not find the character, it should return a NULL pointer, not a pointer to a NULL character.