Guest User

Untitled

a guest
Dec 16th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. typedef struct phones {
  2. int id;
  3. char brand[8];
  4. int price;
  5. int amount;
  6. } PHONES;
  7. int main(int argc, char *argv[]) {
  8. FILE *fin;
  9. int ch;
  10. PHONES *phonep[20];
  11. fin = fopen(argv[1],"r");
  12. for(i=0; i<50; ++i){
  13. fscanf(fin, "%d %s %d %d", &phonep[i]->id,&phonep[i]->brand,&phonep[i]->price,&phonep[i]->amount);
  14. clearBuffer();//This one just passes it on to the next line so it starts at a new item
  15. }
Add Comment
Please, Sign In to add comment