Added: C++ projects
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// Created by David Hackbarth on 21.09.26.
|
||||
//
|
||||
|
||||
#include "helpers.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <ranges>
|
||||
|
||||
int calculateGridIndex(int row, int column)
|
||||
{
|
||||
return row * COLUMNS + column;
|
||||
}
|
||||
|
||||
void printArray(int numbers[])
|
||||
{
|
||||
int length = sizeof(numbers) / sizeof(numbers[0]);
|
||||
// int length2 = std::ranges::size(numbers);
|
||||
|
||||
for (int i = 0; i < length; ++i)
|
||||
{
|
||||
std::cout << "numbers[" << i << "]:" << numbers[i] << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void printArray(int numbers[], size_t length)
|
||||
{
|
||||
for (int i = 0; i < length; ++i)
|
||||
{
|
||||
std::cout << "numbers[" << i << "]:" << numbers[i] << std::endl;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user