-
video @youtube.de; slides @uni-freiburg.de; Exercise Sheet @uni-freiburg.de; code from the lecture @uni-freiburg.de
-
fundamental constructs: see slides
-
make graphical terminal output witch ascii escape sequences
-
to write a
g
at row 20, collumn 60:
printf("x1b[20;60Hg");
-
IO with
ncurses
libary -
wait microseconds with
usleep
(fromunistd.h
) -
to clean with ncurses:
endwin()
- declare global variables in header files, and include in source file. Declare with the
extern
keyword. Initialize in source file - in the makefile:
- use generic rules; Example for the test:
%Test: %.o %Test.o
g++ -o $@ -x $ -lgtest -lpthread
- use
make all
- use variables for compiler and compiler options
- let all
.o
files depend on all headers and the corresponding header file - to avoid declaring the main function in the test, use
-lgtest_main
- to make a rectangle add an inverted space (see ascii escape codes)