consolidate all repos to one for archive

This commit is contained in:
2025-01-28 13:46:42 +01:00
commit a6610fbc7a
5350 changed files with 2705721 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
#include <iostream>
/*
struct Node {
int el;
Node* ptrNext;
};
//void insertAtBeginning(Node* start, int n) {
void insertAtBeginning(Node*& start, int n) {
Node* ptrTemp = new Node;
ptrTemp->el = n;
ptrTemp->ptrNext = start;
start=ptrTemp;
}
//void print(Node*& start) {
void print(Node* start) {
while (start) {
std::cout << start-> el << " ";
start=start->ptrNext;
}
std::cout << std::endl;
}
*/
/*
void print(Node*& start) {
//void print(Node* start) {
Node* temp = start;
while (temp) {
std::cout << temp-> el << " ";
temp=temp->ptrNext;
}
std::cout << std::endl;
}
*/
int main() {
int a = 10;
int b = 20;
int* p_a = &a;
int** p_p_a = &p_a;
std::cout << "a " << &a << " " << a << std::endl;
std::cout << "b " << &b << " " << b << std::endl;
std::cout << "p_a " << &p_a << " " << p_a << " " << *p_a << std::endl;
std::cout << "p_p_a " << &p_p_a << " " << p_p_a << " " << *p_p_a << " " << **p_p_a << std::endl;
std::cout << "------------------------" << std::endl;
/*
//The nullptr keyword represents a null pointer value.
Node* ptrStart = nullptr;
insertAtBeginning(ptrStart, 3);
insertAtBeginning(ptrStart, 2);
insertAtBeginning(ptrStart, 1);
print(ptrStart);
print(ptrStart);
while (ptrStart) {
Node* ptrTemp = ptrStart->ptrNext;
delete ptrStart;
ptrStart=ptrTemp;
}
*/
return 0;
}