Vorbereitungsaufgaben sind fertig

This commit is contained in:
Tobias Kachel 2026-04-07 16:38:08 +02:00
parent 762dd4df86
commit 08d8778929
12 changed files with 53 additions and 25 deletions

View File

@ -0,0 +1,15 @@
#table(
columns: (1fr, auto, auto),
inset: 10pt,
align: horizon,
table.header(
[*Adresse*], [*Inhalt an der Adresse*], [Name der Variablen],
),
`0x7fffffffd7d8`,
\&int\*\*,
matrix,
`0x7fffffffd938`,
\&uadf,
matrix[0]
)

View File

@ -1,8 +1,10 @@
#include <iostream>
using namespace std
#include <eror.h>
#define NUM 0
using namespace std;
int main(){
a = 1 + 2;
cout << a << "\n";
int i;
i = NUM;
cout << i << "\n" ;
}

View File

@ -0,0 +1,3 @@
#pragma once
#define NUM

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -5,30 +5,38 @@ int main()
{
const int nx=3;
const int ny=2;
int** matrix;
const int nz=3;
int*** matrix;
matrix = (int**)malloc(ny*sizeof(int*));
for(int y=0; y<ny; y++)
{
matrix[y] = (int*)malloc(nx*sizeof(int));
for(int x=0; x<nx; x++)
{
matrix[y][x] = (y+1)*10 + x+1;
}
}
matrix = (int***)malloc((ny*sizeof(int**)*nz*sizeof(int)));
for (int z=0; z<nz;z++)
{
matrix[z] = (int**)malloc(ny*sizeof(int*));
for(int y=0; y<ny; y++)
{
matrix[y] = (int**)malloc(nx*sizeof(int));
for(int x=0; x<nx; x++)
{
matrix[z][y][x] = (z+1) * 100 + (y+1)*10 + x+1;
}
}
}
for(int z=0; z<nz; z++)
{
for(int y=0; y<ny; y++)
{
for(int x=0; x<nx; x++)
{
printf("%i ",matrix[z][y][x]);
}
printf("\n");
}
printf("\n");
}
for(int y=0; y<ny; y++)
for(int z=0; z<ny; z++)
{
for(int x=0; x<nx; x++)
{
printf("%i ",matrix[y][x]);
}
printf("\n");
}
for(int y=0; y<ny; y++)
{
free(matrix[y]);
free(matrix[z]);
}
free(matrix);
}

BIN
1_Grundlagen/code/matrix1 Executable file

Binary file not shown.