add sfml project

add containers
This commit is contained in:
2025-02-19 13:32:49 +01:00
parent dc3cfc8fa3
commit 803701d6ef
188 changed files with 32475 additions and 11 deletions
+43 -10
View File
@@ -1,6 +1,8 @@
#include <iostream>
#include <Windows.h>
#include <memory>
#include <vector>
#include <list>
#include "functions.h"
#include "ClassA.h"
#include "ClassB.h"
@@ -142,16 +144,47 @@ int main()
//int const* const icpc;
//const int const* const cicpc;
IComparable* pComparable = nullptr;
IComparable* pComparable2 = new ClassA();
pComparable = new ClassB();
(*pComparable).Compare(pComparable2);
pComparable->Compare(pComparable2); // identical to line above, but simpler
delete pComparable;
pComparable = nullptr;
//delete pComparable2;
//pComparable2 = nullptr;
safeDelete(pComparable2);
//IComparable* pComparable = nullptr;
//IComparable* pComparable2 = new ClassA();
//pComparable = new ClassB();
//(*pComparable).Compare(pComparable2);
//pComparable->Compare(pComparable2); // identical to line above, but simpler
//delete pComparable;
//pComparable = nullptr;
////delete pComparable2;
////pComparable2 = nullptr;
//safeDelete(pComparable2);
//vector<int> numbers = { 0, 10, 15, 4, 457 };
//cout << "numbers size/capacity: " << numbers.size() << " / " << numbers.capacity() << endl;
//numbers.push_back(999);
//cout << "numbers size/capacity: " << numbers.size() << " / " << numbers.capacity() << endl;
//numbers[3] = 65;
//list<int> numbers2 = { 0, 10, 15, 4, 457 };
//list<int>::iterator it = numbers2.begin();
//for (; it != numbers2.end(); it++)
//{
// //*it *= 2;
// cout << *it << " ";
//}
//cout << endl;
//numbers2.insert(--it, 999);
//for (it = numbers2.begin(); it != numbers2.end(); it++)
//{
// //*it *= 2;
// cout << *it << " ";
//}
//cout << endl;
const size_t count = 5;
int numbers[count]; // const size -> stack array
size_t count2 = 10;
int* numbers2 = new int[count2]; // variable size -> heap array
delete[] numbers2;
numbers2 = nullptr;
return 0;
}