cProgHW5Part1

cProgHW5Part1 - C PROGRAMMING HOMEWORK 5 PART 1 #include...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: C PROGRAMMING HOMEWORK 5 PART 1 #include <stdio.h> #include <stdlib.h> #define INPUT_FILE "inputfile.in" typedef char *string; typedef struct person { char name[14]; int age; double height; } person; void sortnmdo(person*, int, int); void sortnmrdo(person*, int, int); void sortageup(person*, int, int); void sorthgtup(person*, int, int); void printfunc(person*, int, int); void swapper(person*, person, int); int main() { FILE *infile; infile= fopen(INPUT_FILE, "r"); if(infile == NULL) { printf("Cannot open file!\n" INPUT_FILE); printf("Terminating program...\n"); exit(1); } int i0[16], i1[16], i2[16], i3[16], i4[16]; int i5[16], i6[16], i7[16], i8[16], i9[16]; int indxnmdo={s0, i1, i2, i3, i4, i5, i6, i7, i8, i9}; int indxnmrdo; int indxageup; int indexhgtup; ////READ FROM FILE ///Input into array ///Display array ///Sort array int counter, inputvar; for (counter=0; counter<10; counter++) //to fill array strings { int store; fscanf(infile, "%i", &store); while(1==fscanf(infile, "%i", &store)); array[counter]=store; inputvar=counter; }...
View Full Document

This note was uploaded on 03/30/2008 for the course CS 212 taught by Professor Dr.frey during the Spring '06 term at New Haven.

Page1 / 3

cProgHW5Part1 - C PROGRAMMING HOMEWORK 5 PART 1 #include...

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