[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

[c] Læse fil med tre kolonner



Hej!
Jeg er ved at konvertere noget MS C++ til linux C. Imidlertid giver mig en 
inputfil lidt problemer:

Struktur af inputfil:
string\tfloat\tfloat\tfloat\n
..

Fx:
CH4    	28.3    	236.34    	363.23
..


I C++ gør jeg sådan:

  /* Load the datafile */
  ifstream inClientFile(inputfileName, ios::in );
  for( i=0; i < MAX_FRACTIONS; i++ )
  {
     inClientFile >> Comp[i] >> MolePercent[i] >> MolecularWeight[i];
     if (MolecularWeight[i] > 0) {
      Components=i+1;
     }
  }
  inClientFile.close();

Hvordan gør jeg i C?


MVH.,
Christian


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *