0% found this document useful (0 votes)
61 views2 pages

ECE 532 Data Structure Revision - Pointers

A C program declares a float array named rates containing the numbers 6.5, 7.2, 7.5, 8.3, 8.6, 9.4, 9.6, 9.8, 10.0 in main. It also declares a pointer ratesPtr that points to rates. The show function is called, passing ratesPtr as a parameter. The show function then uses pointer notation *(ratesPtr+i) to display the numbers in rates.

Uploaded by

Muhd Adha
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views2 pages

ECE 532 Data Structure Revision - Pointers

A C program declares a float array named rates containing the numbers 6.5, 7.2, 7.5, 8.3, 8.6, 9.4, 9.6, 9.8, 10.0 in main. It also declares a pointer ratesPtr that points to rates. The show function is called, passing ratesPtr as a parameter. The show function then uses pointer notation *(ratesPtr+i) to display the numbers in rates.

Uploaded by

Muhd Adha
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab#1

ECE 532 Data Structure Revision - Pointers

Q1
Write a program that has a declaration in main() function to store the following numbers into an array named rates: 6.5, 7.2, 7.5,8.3,8.6,9.4,9.6,9.8, 10.0. Then declare a pointer ratesPtr to point to rates array. There should be a function call to the function named show() that accepts ratesPtr as shown void show(float *ratesPtr), and then display the numbers using the pointer notation *(ratesPtr+i)

You might also like