tutorial7 - in the address(in the function minFrac itself...

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

View Full Document Right Arrow Icon
In void reorder, even though the input are addresses, we don’t use *minFrac(*a,*b) == *b because a and b are addresses, minFrac also an address. So we must compare address with address, since b is address, we use minFrac, not *minFrac But even though minFrac is an address, the function minFrac itself checks the values
Background image of page 1

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

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

Unformatted text preview: in the address (in the function minFrac itself, because in the function minFrac we dereference the addresses with *) Important: (*count)++! *count++ will not work. Need the brackets. This is the best & shortest way of finding gcd int gcd (int a, int b) { int c; While (b!=0) { c= a%b; a=b; b=c; } Return a; }...
View Full Document

This note was uploaded on 01/09/2012 for the course ELECTRICAL 1221 taught by Professor Tan during the Spring '11 term at National University of Singapore.

Page1 / 2

tutorial7 - in the address(in the function minFrac itself...

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