C/C++ Reference
Rather than repeating what’s already well-explained elsewhere, this page collects tutorials, references, and videos for brushing up on C and C++ concepts used in EMBS. If there is a resource that you particularly like and think that others would benefit from it, let us know and we’ll add the link.
Note
For Zynq-specific compiler and linker information, see the C Compilation Tips page.
Getting Started
- learn-c.org - Interactive C tutorial in the browser, covers the very basics
- Programiz C Programming - Clean reference with examples for each topic
Pointers and Memory
- mycodeschool / freeCodeCamp - Pointers in C/C++ - Comprehensive YouTube video course
- learn-c.org - Pointers - Interactive exercises
- Programiz - C Pointers - Written tutorial with examples
- GribbleLab C Boot Camp - Stack vs Heap - Clear written explanation
- GeeksforGeeks - Dynamic Memory Allocation -
malloc,calloc,realloc,freewith examples
Note
In EMBS, malloc on the Zynq works but makes HLS porting harder. See the C Compilation Tips page for linker and heap sizing information.
Bitwise Operations
- GeeksforGeeks - Bitwise Operators - Written tutorial with examples
Common patterns you’ll use frequently:
reg |= (1 << n); // Set bit n
reg &= ~(1 << n); // Clear bit n
reg ^= (1 << n); // Toggle bit n