Skip to content

Instantly share code, notes, and snippets.

@emirozturk
Created March 15, 2018 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emirozturk/068a06f06058fac3d6d0055ea4f20253 to your computer and use it in GitHub Desktop.
Save emirozturk/068a06f06058fac3d6d0055ea4f20253 to your computer and use it in GitHub Desktop.
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