structs - 1 What is wrong with the following C declarations...

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

View Full Document Right Arrow Icon
1. What is wrong with the following C declarations? typedef { double x; double y; } Point; 2. What does the following program do? double POINTdist(Point p, Point q) { double dx = p.x - q.x; double dy = p.y - q.y; return sqrt(dx*dx + dy*dy); } 3. Write a function RECTAREA() that calculates the area of a rectangle in a Cartesian co-ordinate system. 4. Write type definitions using structs that will keep track of customer information and movie information for the manager of a local video store. Take into consideration the following fields for a customer: their account number, their name, their address, their telephone number, their current rentals, the due dates of their videos and also the following - the title, format, the rental price, and the due dates when a customer rents one or more movies. 5. Write a function that makes a copy of a string in a permanent memory. 6. Allocate space for a string of length 6 (that is an array of size 7) 7. What does the following function return? int *sum( int *a, int *b, int dim /* size of a and b */) {
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.

This document was uploaded on 06/12/2011.

Page1 / 3

structs - 1 What is wrong with the following C declarations...

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