NYP Uygulama
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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