Notes - 2.27 - != If fread I sizeof 1 1 fp 1& = I...

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

View Full Document Right Arrow Icon
E E 312 Notes / / 2 27 08 = Argc number of pointers * [] = Char argv each value that is passé into function ( , * []) Int main int argc char argv Command line > . myprog c one two three = Argc 4 [ ] = “ . ” Argv 0 my prog c [ ]=” Argv 1 one [ ] = “ Argv 2 two [ ] = “ Argv 3 three / File i o functions begin with f something = Fprintf printf but in the fline , , Fopen fopen fscanf Binary Streams sequence of bits In unix there is no difference Binary files require a b with every input output , () For binary use fwrite function Returns a value = ; * ; Int I 100 FILE fp ( (& , ( ), , ) != ) If fwrite I sizeof i 1 fp 1 i address of i ( ) = = Sizeof 1 Returns number of bits 4 bits big = 1 1 value = Fp writes to this file , If in arrays can write out values at one time , If it s a single value must use multiple fwrites , () For binary use fread function Reads a value stored in memory up to a value at an address ; * Int i FILE fp ( (& , ( ),
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: , ) != ) If fread I sizeof 1 1 fp 1 & = I address for file to be stored ( ) = Sizeof 1 the number of bits to be read = 1 number of values to be read = Fp source location ( , , ) – Fseek fp 0 seek_set used to move around a file = Fp pointer from file = ( ) the offset number in bytes from the position = ( = , = , = )] Seek_set position that you are at SET beginning END end CUR current ( ) – Ftell fp tells you where you are at = Fp pointer from from file Able to capture where you are at for future reference ( ) – Rewind fp means go back to end beginning of file Array sizes = Double 8 bits = Float 4 bits = Int 2 bits * = 8 bits 10 values 80 bits Recursion – An anchor or base case returns a certain value for a certain parameter – And inductive or recursive case returns a function ! Example N-! = 1-! = * ( - ) N n n 1...
View Full Document

This note was uploaded on 03/22/2008 for the course EE 312 taught by Professor Shafer during the Spring '08 term at University of Texas.

Page1 / 2

Notes - 2.27 - != If fread I sizeof 1 1 fp 1& = I...

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