lecture_25_final

lecture_25_final - 1 item.h 2010-11-15 16:35 David Nicol /*...

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

View Full Document Right Arrow Icon
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
1 · item.h · 2010-11-15 16:35 · David Nicol /* item.h */ typedef struct itemTag item; struct itemTag { char name[50]; int quantity; /* number of items */ float cost; /* cost each item */ item *next; /* pointer to next item in list */ };
Background image of page 4
1 · linked.cc · 2010-11-16 09:05 · David Nicol /* linked.cc */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "item.h" int GetItemAttributes( char *, int *, float *, int ); int DeleteInv(item **, item **, char *, int , float ); int AddInv(item **, item **, char *, int , float ); int main() { char cmdstr[8]; char name[51]; item *inventory_head = NULL ; item *inventory_tail = NULL ; item *ptr = NULL ; int q; float c; while (1) { printf( "enter command L (list), A (add), D (delete), C (calculate) : " ); scanf( "%s" , cmdstr); switch (cmdstr[0]) { case 'L' : case 'l' : ptr = inventory_head; if (ptr) { printf( "----------------------------------------------\n" ); while (ptr) { printf( "There are %d items of stock %s, unit cost %f\n"
Background image of page 5

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

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

This note was uploaded on 08/29/2011 for the course ECE 265 taught by Professor Kosbar during the Fall '09 term at Missouri S&T.

Page1 / 7

lecture_25_final - 1 item.h 2010-11-15 16:35 David Nicol /*...

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

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