Vorbereitungsaufgaben sind fertig
This commit is contained in:
parent
762dd4df86
commit
08d8778929
15
1_Grundlagen/Vorbereitungsaufgaben/Speicheradressen.typ
Normal file
15
1_Grundlagen/Vorbereitungsaufgaben/Speicheradressen.typ
Normal 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]
|
||||
)
|
||||
|
||||
@ -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" ;
|
||||
}
|
||||
|
||||
|
||||
3
1_Grundlagen/Vorbereitungsaufgaben/praeprozessorfehler.h
Normal file
3
1_Grundlagen/Vorbereitungsaufgaben/praeprozessorfehler.h
Normal 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.
BIN
1_Grundlagen/code/core.12622
Normal file
BIN
1_Grundlagen/code/core.12622
Normal file
Binary file not shown.
BIN
1_Grundlagen/code/core.12629
Normal file
BIN
1_Grundlagen/code/core.12629
Normal file
Binary file not shown.
BIN
1_Grundlagen/code/core.14236
Normal file
BIN
1_Grundlagen/code/core.14236
Normal file
Binary file not shown.
Binary file not shown.
@ -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
BIN
1_Grundlagen/code/matrix1
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user