Added: C++ projects
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// Created by David Hackbarth on 22.09.26.
|
||||
//
|
||||
#include "helpers.h"
|
||||
|
||||
void changeInteger(int value)
|
||||
{
|
||||
value *= 10;
|
||||
}
|
||||
|
||||
int changeIntegerByReturn(int value)
|
||||
{
|
||||
return value * 10;
|
||||
}
|
||||
|
||||
bool changeIntegerByPointer(int* pValue)
|
||||
{
|
||||
if (pValue == nullptr)
|
||||
return false;
|
||||
|
||||
*pValue *= 10;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void changeIntegerByReference(int& value)
|
||||
{
|
||||
value *= 10;
|
||||
}
|
||||
|
||||
void createInteger(int* pNumber)
|
||||
{
|
||||
pNumber = new int(0);
|
||||
}
|
||||
|
||||
void createIntegerWithPointerPointer(int** ppNumber)
|
||||
{
|
||||
if (ppNumber == nullptr)
|
||||
return;
|
||||
|
||||
*ppNumber = new int(0);
|
||||
}
|
||||
Reference in New Issue
Block a user