Add examples for presentation

This commit is contained in:
Valentin Brandl 2019-12-18 18:37:52 +01:00
parent abd0defb17
commit e17724b504
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D
5 changed files with 22 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.~lock.*.pptx#

10
presentation/Makefile Normal file
View File

@ -0,0 +1,10 @@
SRC=example.c
CC=gcc
build: nopie pie
nopie:
$(CC) -no-pie -o example.nopie example.c
pie:
$(CC) -pie -o example.pie example.c

11
presentation/example.c Normal file
View File

@ -0,0 +1,11 @@
#include<stdio.h>
void some_function() {
puts("Hello, world!\n");
}
int main() {
void (*function)() = &some_function;
printf("some_function is located at %p\n", function);
return 0;
}

BIN
presentation/example.nopie Executable file

Binary file not shown.

BIN
presentation/example.pie Executable file

Binary file not shown.