Lab5 - Lab5: Pointer to Functions, Wave Files and Bit...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab5: Pointer to Functions, Wave Files and Bit Operations Goal: In this lab you will use pointer to functions to write a generic sorting function. You will also generate music wave files, and finally practice bit operations in "C". Step 1. Download the Initial Files Download the file lab5-src.tar and untar it in your class directory to produce lab5-src . tar -xvf lab5-src.tar You will find a "testall" script that runs all the tests. It also has instructions to run the tests individually. Step2. Write a Sorting Function to Sort any Type of Array Open the file mysort.c . In there you will implement the function void mysort( int n, // Number of elements int elementSize, // Size of each element void * array, // Pointer to an array int ascending, // 0 -> descending; 1 -> ascending CompareFunction compFunc ) // Comparison function. This function takes an "array" of any type, the number "n" of elements, the "elementSize", a comparison function "compFunc" and a flag "ascending" and it will
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Lab5 - Lab5: Pointer to Functions, Wave Files and Bit...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online