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> #include <iostream>
using namespace std #define NUM 0
#include <eror.h> using namespace std;
int main(){ int main(){
a = 1 + 2; int i;
cout << a << "\n"; 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 nx=3;
const int ny=2; const int ny=2;
int** matrix; const int nz=3;
int*** matrix;
matrix = (int**)malloc(ny*sizeof(int*)); matrix = (int***)malloc((ny*sizeof(int**)*nz*sizeof(int)));
for(int y=0; y<ny; y++) for (int z=0; z<nz;z++)
{ {
matrix[y] = (int*)malloc(nx*sizeof(int)); matrix[z] = (int**)malloc(ny*sizeof(int*));
for(int x=0; x<nx; x++) for(int y=0; y<ny; y++)
{ {
matrix[y][x] = (y+1)*10 + x+1; 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 y=0; y<ny; y++) }
{ }
for(int x=0; x<nx; x++) }
{ for(int z=0; z<nz; z++)
printf("%i ",matrix[y][x]); {
} for(int y=0; y<ny; y++)
printf("\n"); {
} 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++)
{ {
free(matrix[y]); free(matrix[z]);
} }
free(matrix); free(matrix);
} }

BIN
1_Grundlagen/code/matrix1 Executable file

Binary file not shown.