int runRestoreBankAndVerify(NDBT_Context* ctx, NDBT_Step* step){ NdbRestarter restarter; NdbBackup backup(GETNDB(step)->getNodeId()+1); unsigned minBackupId = ctx->getProperty("MinBackupId"); unsigned maxBackupId = ctx->getProperty("MaxBackupId"); unsigned backupId = minBackupId; int result = NDBT_OK; int errSumAccounts = 0; int errValidateGL = 0; ndbout << " maxBackupId = " << maxBackupId << endl; ndbout << " minBackupId = " << minBackupId << endl; while (backupId <= maxBackupId){ // TEMPORARY FIX // To erase all tables from cache(s) // To be removed, maybe replaced by ndb.invalidate(); { Bank bank(ctx->m_cluster_connection); if (bank.dropBank() != NDBT_OK){ result = NDBT_FAILED; break; } } // END TEMPORARY FIX ndbout << "Performing restart" << endl; if (restarter.restartAll(false) != 0) return NDBT_FAILED; if (restarter.waitClusterStarted() != 0) return NDBT_FAILED; ndbout << "Dropping " << tabname << endl; NdbDictionary::Dictionary* pDict = GETNDB(step)->getDictionary(); pDict->dropTable(tabname); ndbout << "Restoring backup " << backupId << endl; if (backup.restore(backupId) == -1){ return NDBT_FAILED; } ndbout << "Backup " << backupId << " restored" << endl; // Let bank verify Bank bank(ctx->m_cluster_connection); int wait = 0; int yield = 1; if (bank.performSumAccounts(wait, yield) != 0){ ndbout << "bank.performSumAccounts FAILED" << endl; ndbout << " backupId = " << backupId << endl << endl; result = NDBT_FAILED; errSumAccounts++; } if (bank.performValidateAllGLs() != 0){ ndbout << "bank.performValidateAllGLs FAILED" << endl; ndbout << " backupId = " << backupId << endl << endl; result = NDBT_FAILED; errValidateGL++; } backupId++; } if (result != NDBT_OK){ ndbout << "Verification of backup failed" << endl << " errValidateGL="<<errValidateGL<<endl << " errSumAccounts="<<errSumAccounts<<endl << endl; } return result; }
int main(int argc, char **argv) { gridpack::parallel::Environment env(argc, argv); // Create an artificial scope so that all objects call their destructors // before GA_Terminate is called if (1) { gridpack::parallel::Communicator world; int me = world.rank(); int nproc = world.size(); if (me == 0) { printf("Testing GlobalStore on %d processors\n\n",nproc); } int lo = me*MAX_VEC/nproc; int hi = (me+1)*MAX_VEC/nproc-1; int i, j; gridpack::parallel::GlobalStore<data_type> bank(world); // Store vectors in global store object for (i=lo; i<=hi; i++) { std::vector<data_type> vec; for (j=0; j<VEC_LEN+me; j++) { data_type item; item.ival = j+me; item.dval = static_cast<double>(j+me+1); vec.push_back(item); } //printf("p[%d] vec[%d].size: %d\n",me,i,vec.size()); bank.addVector(i,vec); } // Upload vectors to global data object bank.upload(); // Check values if (me < nproc-1) { lo = (me+1)*MAX_VEC/nproc; hi = (me+2)*MAX_VEC/nproc-1; } else { lo = 0; hi = MAX_VEC/nproc-1; } int ichk = me + 1; if (me==nproc-1) ichk = 0; int chk = 1; for (i=lo; i<=hi; i++) { std::vector<data_type> vec; bank.getVector(i, vec); for (j=0; j<VEC_LEN+ichk; j++) { bool ok = false; if (vec[j].ival == j+ichk && vec[j].dval == static_cast<double>(j+ichk+1)) ok = true; if (!ok && j==0) { printf("p[%d] Mistake found at (vec[%d])[%d]. Expected ival: %d dval: %d" " Actual ival: %f dval: %f\n",me,i,j,j+ichk,vec[j].ival, static_cast<double>(j+ichk+1),vec[j].dval); chk = 0; } } } world.sync(); world.sum(&chk,1); if (chk == nproc && me == 0) { printf("Vectors OK\n"); } else if (chk < nproc && me == 0) { printf("Error found in vectors\n"); } } return 0; }
int runDropBank(NDBT_Context* ctx, NDBT_Step* step){ Bank bank(ctx->m_cluster_connection); if (bank.dropBank() != NDBT_OK) return NDBT_FAILED; return NDBT_OK; }
// Lucre step 3: the mint signs the token // bool OTMint_Lucre::SignToken(OTPseudonym & theNotary, OTToken & theToken, OTString & theOutput, int32_t nTokenIndex) { bool bReturnValue = false; //OTLog::Error("%s <bank file> <coin request> <coin signature> [<signature repeats>]\n", _OT_Lucre_Dumper setDumper; // OTLog::vError("OTMint::SignToken!!\nnTokenIndex: %d\n Denomination: %lld\n", nTokenIndex, theToken.GetDenomination()); OpenSSL_BIO bioBank = BIO_new(BIO_s_mem()); // input OpenSSL_BIO bioRequest = BIO_new(BIO_s_mem()); // input OpenSSL_BIO bioSignature = BIO_new(BIO_s_mem()); // output OTASCIIArmor thePrivate; GetPrivate(thePrivate, theToken.GetDenomination()); // The Mint private info is encrypted in m_mapPrivates[theToken.GetDenomination()]. // So I need to extract that first before I can use it. OTEnvelope theEnvelope(thePrivate); OTString strContents; // output from opening the envelope. // Decrypt the Envelope into strContents if (!theEnvelope.Open(theNotary, strContents)) return false; // copy strContents to a BIO BIO_puts(bioBank, strContents.Get()); // OTLog::vError("BANK CONTENTS:\n%s--------------------------------------\n", strContents.Get()); // Instantiate the Bank with its private key Bank bank(bioBank); // OTLog::vError("BANK INSTANTIATED.--------------------------------------\n"); // I need the request. the prototoken. OTASCIIArmor ascPrototoken; bool bFoundToken = theToken.GetPrototoken(ascPrototoken, nTokenIndex); if (bFoundToken) { // base64-Decode the prototoken OTString strPrototoken(ascPrototoken); // OTLog::vError("\n--------------------------------------\nDEBUG: PROTOTOKEN CONTENTS:\n" // "-----------------%s---------------------\n", strPrototoken.Get() ); // copy strPrototoken to a BIO BIO_puts(bioRequest, strPrototoken.Get()); // Load up the coin request from the bio (the prototoken) PublicCoinRequest req(bioRequest); // OTLog::Error("PROTOTOKEN INSTANTIATED.--------------------------------------\n"); // Sign it with the bank we previously instantiated. // results will be in bnSignature (BIGNUM) BIGNUM * bnSignature = bank.SignRequest(req); if (NULL == bnSignature) { OTLog::Error("MAJOR ERROR!: Bank.SignRequest failed in OTMint_Lucre::SignToken\n"); } else { // OTLog::Error("BANK.SIGNREQUEST SUCCESSFUL.--------------------------------------\n"); // Write the request contents, followed by the signature contents, // to the Signature bio. Then free the BIGNUM. req.WriteBIO(bioSignature); // the original request contents DumpNumber(bioSignature,"signature=", bnSignature); // the new signature contents BN_free(bnSignature); // Read the signature bio into a C-style buffer... char sig_buf[1024]; // todo stop hardcoding these string lengths // memset(sig_buf, 0, 1024); // zero it out. (I had this commented out, but the size was 2048, so maybe it's safe now at 1024.) int32_t sig_len = BIO_read(bioSignature, sig_buf, 1000); // cutting it a little short on purpose, with the buffer. Just makes me feel more comfortable for some reason. // Add the null terminator by hand (just in case.) sig_buf[sig_len] = '\0'; if (sig_len) { // *********************************************** // OTLog::vError("\n--------------------------------------\n" // "*** Siglen is %d. sig_str_len is %d.\nsig buf:\n------------%s------------\nLAST " // "CHARACTER IS '%c' SECOND TO LAST CHARACTER IS '%c'\n", // sig_len, sig_str_len, sig_buf, sig_buf[sig_str_len-1], sig_buf[sig_str_len-2]); // Copy the original coin request into the spendable field of the token object. // (It won't actually be spendable until the client processes it, though.) theToken.SetSpendable(ascPrototoken); // OTLog::vError("*** SPENDABLE:\n-----------%s---------------------\n", ascPrototoken.Get()); // Base64-encode the signature contents into theToken.m_Signature. OTString strSignature(sig_buf); // strSignature.Set(sig_buf, sig_len-1); // sig_len includes null terminator, whereas Set() adds 1 for it. // OTLog::vError("SIGNATURE:\n--------------------%s" // "------------------\n", strSignature.Get()); // Here we pass the signature back to the caller. // He will probably set it onto the token. theOutput.Set(sig_buf, sig_len); bReturnValue = true; // This is also where we set the expiration date on the token. // The client should have already done this, but we are explicitly // setting the values here to prevent any funny business. theToken.SetSeriesAndExpiration(m_nSeries, m_VALID_FROM, m_VALID_TO); } } } return bReturnValue; }
// The mint has a different key pair for each denomination. // Pass the actual denomination such as 5, 10, 20, 50, 100... bool OTMint_Lucre::AddDenomination(OTPseudonym & theNotary, int64_t lDenomination, int32_t nPrimeLength/*=1024*/) { OT_ASSERT(NULL != m_pKeyPublic); bool bReturnValue = false; // Let's make sure it doesn't already exist OTASCIIArmor theArmor; if (GetPublic(theArmor, lDenomination)) { // it already exists. OTLog::Error("Error: Denomination public already exists in OTMint::AddDenomination\n"); return false; } if (GetPrivate(theArmor, lDenomination)) { // it already exists. OTLog::Error("Error: Denomination private already exists in OTMint::AddDenomination\n"); return false; } // OTLog::Error("%s <size of bank prime in bits> <bank data file> <bank public data file>\n", if ((nPrimeLength/8) < (MIN_COIN_LENGTH+DIGEST_LENGTH)) { OTLog::vError("Prime must be at least %d bits\n", (MIN_COIN_LENGTH+DIGEST_LENGTH)*8); return false; } if (nPrimeLength%8) { OTLog::Error("Prime length must be a multiple of 8\n"); return false; } #ifdef _WIN32 SetMonitor("openssl.dump"); #else SetMonitor(stderr); #endif OpenSSL_BIO bio = BIO_new(BIO_s_mem()); OpenSSL_BIO bioPublic = BIO_new(BIO_s_mem()); // Generate the mint private key information Bank bank(nPrimeLength/8); bank.WriteBIO(bio); // Generate the mint public key information PublicBank pbank(bank); pbank.WriteBIO(bioPublic); // Copy from BIO back to a normal OTString or Ascii-Armor char privateBankBuffer[4096], publicBankBuffer[4096]; // todo stop hardcoding these string lengths int32_t privatebankLen = BIO_read(bio, privateBankBuffer, 4000); // cutting it a little short on purpose, with the buffer. int32_t publicbankLen = BIO_read(bioPublic, publicBankBuffer, 4000); // Just makes me feel more comfortable for some reason. if (privatebankLen && publicbankLen) { // With this, we have the Lucre public and private bank info converted to OTStrings OTString strPublicBank; strPublicBank.Set(publicBankBuffer, publicbankLen); OTString strPrivateBank; strPrivateBank.Set(privateBankBuffer, privatebankLen); OTASCIIArmor * pPublic = new OTASCIIArmor(); OTASCIIArmor * pPrivate = new OTASCIIArmor(); OT_ASSERT(NULL != pPublic); OT_ASSERT(NULL != pPrivate); // Set the public bank info onto pPublic pPublic->SetString(strPublicBank, true); // linebreaks = true // Seal the private bank info up into an encrypted Envelope // and set it onto pPrivate OTEnvelope theEnvelope; theEnvelope.Seal(theNotary, strPrivateBank); // Todo check the return values on these two functions theEnvelope.GetAsciiArmoredData(*pPrivate); // Add the new key pair to the maps, using denomination as the key m_mapPublic[lDenomination] = pPublic; m_mapPrivate[lDenomination] = pPrivate; // Grab the Server Nym ID and save it with this Mint theNotary.GetIdentifier(m_ServerNymID); // --------------------------- // Grab the Server's public key and save it with this Mint // const OTAsymmetricKey & theNotaryPubKey = theNotary.GetPublicSignKey(); delete m_pKeyPublic; m_pKeyPublic = theNotaryPubKey.ClonePubKey(); // --------------------------- m_nDenominationCount++; // --------------------------- // Success! bReturnValue = true; OTLog::vOutput(1, "Successfully added denomination: %lld\n", lDenomination); } return bReturnValue; }
/** Prints the contents of each group as XML tags and values */ int SaveToSNSHistogramNexus::WriteGroup(int is_definition) { int status, dataType, dataRank, dataDimensions[NX_MAXRANK]; NXname name, theClass; void *dataBuffer; NXlink link; do { status = NXgetnextentry(inId, name, theClass, &dataType); // std::cout << name << "(" << theClass << ")\n"; if (status == NX_ERROR) return NX_ERROR; if (status == NX_OK) { if (!strncmp(theClass, "NX", 2)) { if (NXopengroup(inId, name, theClass) != NX_OK) return NX_ERROR; add_path(name); if (NXgetgroupID(inId, &link) != NX_OK) return NX_ERROR; if (!strcmp(current_path, link.targetPath)) { // Create a copy of the group if (NXmakegroup(outId, name, theClass) != NX_OK) return NX_ERROR; if (NXopengroup(outId, name, theClass) != NX_OK) return NX_ERROR; if (WriteAttributes(is_definition) != NX_OK) return NX_ERROR; if (WriteGroup(is_definition) != NX_OK) return NX_ERROR; remove_path(name); } else { remove_path(name); strcpy(links_to_make[links_count].from, current_path); strcpy(links_to_make[links_count].to, link.targetPath); strcpy(links_to_make[links_count].name, name); links_count++; if (NXclosegroup(inId) != NX_OK) return NX_ERROR; } } else if (!strncmp(theClass, "SDS", 3)) { add_path(name); if (NXopendata(inId, name) != NX_OK) return NX_ERROR; if (NXgetdataID(inId, &link) != NX_OK) return NX_ERROR; std::string data_label(name); if (!strcmp(current_path, link.targetPath)) { // Look for the bank name std::string path(current_path); std::string bank(""); size_t a = path.rfind('/'); if (a != std::string::npos && a > 0) { size_t b = path.rfind('/', a - 1); if (b != std::string::npos && (b < a) && (a - b - 1) > 0) { bank = path.substr(b + 1, a - b - 1); // std::cout << current_path << ":bank " << bank << "\n"; } } //--------------------------------------------------------------------------------------- if (data_label == "data" && (bank != "")) { if (this->WriteDataGroup(bank, is_definition) != NX_OK) return NX_ERROR; ; } //--------------------------------------------------------------------------------------- else if (data_label == "time_of_flight" && (bank != "")) { // Get the original info if (NXgetinfo(inId, &dataRank, dataDimensions, &dataType) != NX_OK) return NX_ERROR; // Get the X bins const MantidVec &X = inputWorkspace->readX(0); // 1 dimension, with that number of bin boundaries dataDimensions[0] = static_cast<int>(X.size()); // The output TOF axis will be whatever size in the workspace. boost::scoped_array<float> tof_data(new float[dataDimensions[0]]); // And fill it with the X data for (size_t i = 0; i < X.size(); i++) tof_data[i] = float(X[i]); if (NXcompmakedata(outId, name, dataType, dataRank, dataDimensions, NX_COMP_LZW, dataDimensions) != NX_OK) return NX_ERROR; if (NXopendata(outId, name) != NX_OK) return NX_ERROR; if (WriteAttributes(is_definition) != NX_OK) return NX_ERROR; if (NXputdata(outId, tof_data.get()) != NX_OK) return NX_ERROR; if (NXclosedata(outId) != NX_OK) return NX_ERROR; } //--------------------------------------------------------------------------------------- else { // Everything else gets copies if (NXgetinfo(inId, &dataRank, dataDimensions, &dataType) != NX_OK) return NX_ERROR; if (NXmalloc(&dataBuffer, dataRank, dataDimensions, dataType) != NX_OK) return NX_ERROR; if (NXgetdata(inId, dataBuffer) != NX_OK) return NX_ERROR; if (NXcompmakedata(outId, name, dataType, dataRank, dataDimensions, NX_COMP_LZW, dataDimensions) != NX_OK) return NX_ERROR; if (NXopendata(outId, name) != NX_OK) return NX_ERROR; if (WriteAttributes(is_definition) != NX_OK) return NX_ERROR; if (NXputdata(outId, dataBuffer) != NX_OK) return NX_ERROR; if (NXfree(&dataBuffer) != NX_OK) return NX_ERROR; if (NXclosedata(outId) != NX_OK) return NX_ERROR; } remove_path(name); } else { // Make a link remove_path(name); strcpy(links_to_make[links_count].from, current_path); strcpy(links_to_make[links_count].to, link.targetPath); strcpy(links_to_make[links_count].name, name); links_count++; } if (NXclosedata(inId) != NX_OK) return NX_ERROR; } } else if (status == NX_EOD) { if (NXclosegroup(inId) != NX_OK) return NX_ERROR; if (NXclosegroup(outId) != NX_OK) return NX_ERROR; return NX_OK; } } while (status == NX_OK); return NX_OK; }
Layer::List Factory::toLayers(Data::Base& data) { Layer::List layers; //qDebug() << "Layer::Factory converting" << Data::Type::toString(data.typeID()); try { switch (data.typeID()) { case Data::Type::Bank: { Data::Bank& bank(dynamic_cast<Data::Bank&>(data)); layers << convert(bank); } break; case Data::Type::GeometryList: { Data::GeometryList& list(dynamic_cast<Data::GeometryList&>(data)); layers << convert(list); } break; case Data::Type::Geometry: { Data::Geometry& geometry(dynamic_cast<Data::Geometry&>(data)); layers << convert(geometry); } break; case Data::Type::PointChargeList: { Data::PointChargeList& charges(dynamic_cast<Data::PointChargeList&>(data)); layers << convert(charges); } break; case Data::Type::MolecularOrbitalsList: { Data::MolecularOrbitalsList& list(dynamic_cast<Data::MolecularOrbitalsList&>(data)); layers << convert(list); } break; case Data::Type::MolecularOrbitals: { Data::MolecularOrbitals& molecularOrbitals(dynamic_cast<Data::MolecularOrbitals&>(data)); layers.append(new MolecularOrbitals(molecularOrbitals)); } break; case Data::Type::ExcitedStates: { Data::ExcitedStates& states(dynamic_cast<Data::ExcitedStates&>(data)); layers.append(new ExcitedStates(states)); } break; case Data::Type::Frequencies: { Data::Frequencies& frequencies(dynamic_cast<Data::Frequencies&>(data)); layers.append(new Frequencies(frequencies)); } break; case Data::Type::FileList: { Data::FileList& fileList(dynamic_cast<Data::FileList&>(data)); layers << convert(fileList); } break; case Data::Type::GridData: { QLOG_WARN() << "Data::GridData passed to LayerFactory"; //Data::GridData& grid(dynamic_cast<Data::GridData&>(data)); //layers.append(new CubeData(grid)); } break; case Data::Type::CubeData: { Data::CubeData& cube(dynamic_cast<Data::CubeData&>(data)); layers.append(new CubeData(cube)); } break; case Data::Type::EfpFragment: { Data::EfpFragment& efp(dynamic_cast<Data::EfpFragment&>(data)); layers.append(new EfpFragment(efp)); } break; case Data::Type::EfpFragmentList: { Data::EfpFragmentList& efpList(dynamic_cast<Data::EfpFragmentList&>(data)); layers << convert(efpList); } break; case Data::Type::Mesh: { Data::Mesh& meshData(dynamic_cast<Data::Mesh&>(data)); Data::Surface surface(meshData); Layer::Surface* surfaceLayer(new Surface(surface)); surfaceLayer->setCheckState(Qt::Checked); layers.append(surfaceLayer); } break; case Data::Type::Surface: { Data::Surface& surfaceData(dynamic_cast<Data::Surface&>(data)); Layer::Surface* surfaceLayer(new Surface(surfaceData)); surfaceLayer->setCheckState(surfaceData.isVisible() ? Qt::Checked : Qt::Unchecked); layers.append(surfaceLayer); } break; case Data::Type::Nmr: { Data::Nmr& nmrData(dynamic_cast<Data::Nmr&>(data)); Layer::Nmr* nmrLayer(new Nmr(nmrData)); layers.append(nmrLayer); } break; default: QLOG_WARN() << "Unimplemented data type in Layer::Factory" << Data::Type::toString(data.typeID()); break; } } catch (const std::bad_cast& e) { QLOG_ERROR() << "Data cast in Layer::Factory failed" << Data::Type::toString(data.typeID()); } return layers; }
int main(int argc, char** argv) { Player **Gamer; int numberOfGamers = 6; // количество игроков за столом int numberOfRounds=4; Gamer = new Player*[6]; // 6 игроков Pack Cards(0); // колода карт Card FiveCard[5]; // 5 общих карт int nRound = 1; // первый круг торговли /* создадим numberOfGamers игроков */ for (int i = 0; i < numberOfGamers; i++) { Gamer[i] = new Player("Gamer" + from_int(i), 50, i); Gamer[i][0].SetCards(Cards.getCard(), Cards.getCard()); std::cout << Gamer[i][0].getLogin() << " " << Gamer[i][0].GetFirstCard().getRank() << " of " << Gamer[i][0].GetFirstCard().getSuit() << " "; std::cout << Gamer[i][0].GetSecondCard().getRank() << " of " << Gamer[i][0].GetSecondCard().getSuit() << std::endl; } // ставки игроков для теста /* int Stavki[4][6] = { { 2, 2, 2, 2, 2, 2 }, { 6, 5, 6, 6, 6, 6 }, { 6, 0, 4, 5, 6, 6 }, { 2, 0, 0, 0, 4, 5 } };*/ int **Stavki= new int*[numberOfRounds]; for (int i=0;i<numberOfRounds;i++) Stavki[i]= new int[numberOfGamers]; createSetOfStakes(Stavki,numberOfRounds,numberOfGamers); // объявление банка Bank bank(Gamer, numberOfGamers); // круг торговли и заполнение банка std::cout << "Round " << nRound << std::endl; // ставки игроков for (int i = 0; i < numberOfGamers; i++) { std::cout << "Gamer" << i + 1 << " stake is " << Stavki[nRound - 1][i] << " "; bank.addPlayer(*Gamer[i], Stavki[nRound - 1][i], nRound - 1); } std::cout << std::endl; std::cout << "------------Card Pack-----------" << std::endl; for (int i = 0; i < 3; i++) { FiveCard[i] = Cards.getCard(); std::cout << FiveCard[i].getRank() << " of " << FiveCard[i].getSuit() << std::endl; } // круг торговли и заполнение банка std::cout << "Round " << ++nRound <<std::endl; // ставки игроков for (int i = 0; i < numberOfGamers; i++) { std::cout << "Gamer" << i + 1 << " stake is" << Stavki[nRound - 1][i] << " "; bank.addPlayer(*Gamer[i], Stavki[nRound - 1][i], nRound - 1); } std::cout << std::endl; std::cout << "------------Card Pack-----------" << std::endl; FiveCard[3] = Cards.getCard(); for (int i = 0; i < 4; i++) { std::cout << FiveCard[i].getRank() << " of " << FiveCard[i].getSuit() << std::endl; } // круг торговли и заполнение банка std::cout << "Round " << ++nRound << std::endl;; // ставки игроков for (int i = 0; i < numberOfGamers; i++) { std::cout << "Gamer" << i + 1 << " stake is " << Stavki[nRound - 1][i] << " "; bank.addPlayer(*Gamer[i], Stavki[nRound - 1][i], nRound - 1); } std::cout << std::endl; std::cout << "------------Card Pack-----------" << std::endl; FiveCard[4] = Cards.getCard(); for (int i = 0; i < 5; i++) { std::cout << FiveCard[i].getRank() << " of " << FiveCard[i].getSuit() << std::endl; } // последний круг торговли и заполнение банка std::cout << "Round " << ++nRound << std::endl; // ставки игроков for (int i = 0; i < numberOfGamers; i++) { std::cout << "Gamer" << i + 1 << " stake is" << Stavki[nRound - 1][i] << " "; bank.addPlayer(*Gamer[i], Stavki[nRound - 1][i], nRound - 1); } std::cout << std::endl; Calculation counting(Gamer, FiveCard, 6); counting.WinnersCalc(); for (int i = 0; i < 6; i++) { std::cout << Gamer[i][0].getLogin() << " is in " << Gamer[i][0].getWinPlace() << " place " << " has " << counting.GetCombinationName(Gamer[i]) << std::endl; } // раздача денег bank.winners(); std::cout << std::endl; for (int i = 0; i < numberOfGamers; i++) { std::cout << "Position table: " << Gamer[i]->getPosition() << " "<<Gamer[i]->getLogin()<<" "; std::cout << Gamer[i]->getPurse() << "$"<<std::endl; } std::cout << "SumBank: " << bank.getSumBank() << std::endl; for (int i = 0; i < 6; i++) { delete[] Gamer[i]; } delete[] Gamer; return 0; }