Advertisement
Guest User

A*

a guest
Mar 31st, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <malloc.h>
  3.  
  4. struct t1 {
  5.                 int Name;
  6.                 int coord_x;
  7.                 int coord_y;
  8.             };
  9.  
  10. int main()
  11. {
  12.     FILE *file;
  13.         file = fopen ("tesx1.txt","r");
  14.     //FILE *vivod1;
  15.     //  vivod1 = fopen ("vivod.txt", "w");
  16.  
  17.  
  18.         struct t1 *dano;
  19.     dano = (struct t1 *)malloc(sizeof(struct t1)*100);
  20.  
  21.         int i=1;
  22.  
  23.         while (fscanf (file, "%d; %d;%d\n", &dano[i].Name, &dano[i].coord_x, &dano[i].coord_y)==3)
  24.         {
  25.             i++;
  26.             if (i>9) break;
  27.         }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement