daily pastebin goal
55%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #define INPUTSIZE 50
  3.  
  4.  
  5.  
  6. Consortium *readConsortium (char *input)
  7.  
  8. {
  9.     char *token
  10.  
  11.     int ii = 0;
  12.     int gg = 0;
  13.     int coreCount = 0;
  14.     int associateCount = 0;
  15.  
  16.     FILE* f;
  17.     f = fopen(input, r);
  18.  
  19.     Company *company;
  20.  
  21.     *company = (*company)malloc(sizeof(Company));
  22.     Consortium consortium;
  23.  
  24.     fscanf(f, "%d", token);
  25.     consortium->numCoreMembers = token;
  26.     coreCount = token;
  27.  
  28.     fscanf(f, "%d", (int)token);
  29.     consortium->numAssociateMembers = (int)token;
  30.     associateCount = token;
  31.    
  32.     while (ii <= coreCount)
  33.     {
  34.         fscanf(f, "%c", token);
  35.         consortium->coreMembers[ii]->code = token; 
  36.  
  37.         fscanf(f, "%f", token);
  38.         consortium->coreMembers[ii]->sharePrice = (double)token;   
  39.  
  40.         fscanf(f, "%d", token);
  41.         consortium->coreMembers[ii]->totalShare = (int)token;  
  42.  
  43.         fscanf(f, "%f", token);
  44.         consortium->coreMembers[ii]->totalAssetVal = (double)token;
  45.  
  46.         fscanf(f, "%f", token);
  47.         consortium->coreMembers[ii]->totalDebt = (double)token;
  48.  
  49.         ii++
  50.     }
  51.  
  52.     while (gg <= associateCount)
  53.     {
  54.         fscanf(f, "%s", token);
  55.         consortium->associateMembers[gg]->code = token;
  56.  
  57.         fscanf(f, "%f", token);
  58.         consortium->associateMembers[gg]->sharePrice = (double)token;  
  59.  
  60.         fscanf(f, "%d", token);
  61.         consortium->associateMembers[gg]->totalShare = (int)token; 
  62.  
  63.         fscanf(f, "%f", token);
  64.         consortium->associateMembers[gg]->totalAssetVal = (double)token;   
  65.  
  66.         fscanf(f, "%f", token);
  67.         consortium->associateMembers[gg]->totalDebt = (double)token;   
  68.  
  69.         gg++
  70.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top