![]() |
ENSDF++ 1.1
An easy, fast and simple way to run querys towards the ENSDF database, written in C++.
|
00001 #include "MassPrinter.h" 00002 00003 int main() 00004 { 00005 int thisVariableIsOnlyUsedToAvoidCompilerWarnings = 0; 00006 printf("Loading nucleid mass table..."); fflush(stdout); 00007 MassTable myMassTable("../ENSDF_MASSTABLE/mass.mas03"); 00008 printf("done\n"); 00009 printf("Enter output file name: "); fflush(stdout); fflush(stdin); 00010 char * myD = new char[255]; 00011 thisVariableIsOnlyUsedToAvoidCompilerWarnings=scanf("%s", myD); 00012 FILE * myFile = fopen(myD, "w"); 00013 if(myFile==NULL) 00014 { 00015 perror("File could not be opened."); 00016 return 1; 00017 } 00018 list<MassObject> myList = myMassTable.getMassObjects(); 00019 fprintf(myFile, "0 1 n\n"); 00020 for(list<MassObject>::iterator it = myList.begin(); it!=myList.end(); it++) 00021 { 00022 fprintf(myFile, "%d %d %s\n", it->getNukleid().getZ(), it->getNukleid().getA(), it->getNukleid().getElement().c_str()); 00023 } 00024 fclose(myFile); 00025 printf("File successfully created, finishing.\n"); 00026 return 0; 00027 }