add intro c++

This commit is contained in:
2025-02-05 13:00:51 +01:00
commit 4c7ee6f3a6
9 changed files with 853 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
#include "functions.h"
#include <iostream>
void functionF() {}
void printArray(int numbers[], size_t count)
{
for (size_t i = 0; i < count; i++)
{
std::cout << numbers[i] << " ";
}
std::cout << std::endl;
}
void changeInt(int n)
{
std::cout << "addr of n: " << &n << std::endl;
n *= 10;
}
void changeIntPointer(int* pN)
{
if (pN == nullptr) return;
std::cout << "addr of pN: " << &pN << std::endl;
std::cout << "pN: " << pN << std::endl;
*pN *= 10;
}
void changeIntReference(int& n)
{
std::cout << "addr of n: " << &n << std::endl;
n *= 10;
}