Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
NYP Uygulama
#include <iostream>
#include <string>
using namespace std;
class sinif{
private:
string parametre;
public:
sinif()
{
}
sinif(string p)
{
parametre = p;
cout << parametre << " ile yapici"<< endl;
}
~sinif()
{
cout << parametre << " ile yikici"<< endl;
}
};
sinif sGlobal("global");
sinif *sGlobalDinamik = new sinif("global dinamik");
void fonksiyon()
{
sinif sFonksiyon("fonksiyon");
sinif *sFonksiyonDinamik = new sinif("fonksiyon dinamik");
}
void bellekTestStatik()
{
sinif bellek[10000];
}
void bellekTestDinamik()
{
sinif *bellek[10000];
for (int i = 0; i < 10000; i++)
bellek[i] = new sinif(to_string(i));
int breakPoint;
//for (int i = 0; i < 10000; i++)
// delete bellek[i];
}
int main()
{
sinif sMain("main");
sinif *sMainDinamik = new sinif("main dinamik");
fonksiyon();
bellekTestStatik();
bellekTestDinamik();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment