links - SysPCA

Info

Hilfsmittel SystemProgramming&ComputerArchitecture

none

Exercises

Vorlesung

#timestamp 20250916

#timestamp 20250917

C-Workflow
Pasted image 20250917103703.png

// conditionals
if(statement) else

switch(integrer) {
	case const_1: sth; break;
	case const_2: sth; break;
	default; break;
}
// functions
return;
// loops
for(initial; test; increment) statement
while(bool_expression) statement
do statement while (bool_expression)
// jumps
break
continue
goto label
// I/O (not part of C)
printf()
// basic types
// - declatations
// - scopes and static
int
float
bool // (just int)
void
const
enum

Pasted image 20250917114422.png

#timestamp 2025-09-23

#timestamp 2025-10-01

int *p;                   // p is a pointer to int
int *p[13];               // p is an array[13] of pointers to int
int *(p[13]);             // p is an array[13] of pointers to int
int **p;                  // p is a pointer to a pointer to an int
int (*p)[13];             // p is a pointer to an array[13] of int
int *f();                 // f is a function returning a pointer to int
int (*f)();               // f is a pointer to a function returning int
int (*(*f())[13])();      // f is a function returning a pointer to an array[13] of pointers to functions returning int
int (*(*x[3])())[5];      // x is an array[3] of pointers to functions returning pointers to array[5] of ints

#timestamp 2025-10-12

Always check the return value of malloc!!

#timestamp 2025-10-31