Files
hwr2023_a/CPlusPlus/intro/functions.cpp
T
2025-02-05 13:00:51 +01:00

35 lines
563 B
C++

#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;
}