Corso avanzato di programmazione in C, sviluppato con C++ Institute, aiuta ad acquisire conoscenza della sintassi e della semantica del linguaggio C, nonché tipi di dati avanzati come librerie, concetti di programmazione e strumenti di sviluppo, capacità di identificare bug e colli di bottiglia di codice, programmazione di strutture dati avanzate, risoluzione di problemi non banali con l’utilizzo di strutture dati e algoritmi, progettazione e scrittura di programmi mediante infrastrutture linguistiche standard
Il corso prepara alla certificazione CLP 12-01.
Evolution of C – from past to eternity
- milestones: ANSI C, C89, C95, C99, C11
- obsolete (but still valid) language elements
- how function declaration changed over time?
- trigraphs and digraphs
- new C11 keywords:
- __Noreturn
- _Alignof and _Alignas
- _Bool
- _Exit
- _Complex
- _Pragma, _ _func_ _
- _Generic
Handling variable number of parameters (<stdarg.h>)
- calling conventions, parameters passing, stack usage, stack frame, returning a value, recursion
- va_start()
- va_arg()
- va_end()
- va_copy()
- vsprintf(), vprintf(), vfprintf()
- vscanf(), vsscanf(), vfscanf()
- _ _VA_ARGS_ _
Low level IO (<unistd.h>)
- POSIX, API, ABI, WINAPI, etc.
- access()
- open()
- errno
- close()
- read()
- write()
- lseek()
- dprintf()
- stat()
- symlink(), link()
- readlink()
- unlink()
- fcntl() and ioctl()
Memory and strings (<string.h> et al.)
- manipulating memory blocks
- string manipulation: strchr(), strrchr(), strstr(), strtok()
- qsort(), bsearch()
- aligned_alloc(), calloc(), malloc(), and realloc()
- bcopy()
- memcpy()
- memccpy()
- memmove()
- bzero()
- memset()
- memcmp()
- Internationalization I18N
- UCS, UTF-8 – how to deal with multilingual environment?
- universal character names
- wide characters support in different C dialects (e.g., <wchar.h>, <wctype.h>)
- strcoll() and wcscoll()
Processes and threads
- definitions, implementations and history
- thread safety
- system(), getenv(), setenv()
- processes in Unix way:
- fork()
- exit()
- execxx()
- wait() and waitpid()
- processes in MS Windows way:
- CreateProcess()
- WaitForSingleObject()
- POSIX threads
- MS Windows threads
- C11 threads (<thread.h>)
Floats and ints once again (<math.h>, <fenv.h>, <inttypes.h> et al.)
- IEEE-754: a different universe
- NaN, infinity, zero
- floats and doubles – should we trust them?
- numerical anomalies vs precision
- ULP
- what is pragma?
- FENV_ACCESS pragma
- floating-point exceptions
- rounding
- multi-precision libraries (GMP, MPFR, MPIR)
Network sockets – absolute basics
- what is a socket? what is a network socket?
- TCP/IP protocol stack, UDP
- connection and connectionless transmissions
- servers and clients
- big and little endians and why you should be aware of them
- socket addressing: IP4, IP6, service numbers
- getaddrinfo()
- socket()
- connect()
- bind()
- listen()
- accept()
- send() and recv()
- simple example of client-server communication
- simple example of peer-to-peer communication
Miscellaneous
- const variables vs. volatile variables
- goto – why and why not, advantages, disadvantages and limitations
- long (non-local) jumps: setjmp() and longjmp()
- static array indices, designated initializers, compound literals, variable-length arrays, flexible array members, restrict keyword
- sequence points: why ++/– may sometimes make you crazy?
- the asm keyword
- portability issues and undefined behaviours
In definizione