Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Find Middle Index Without Integer Overflow | C Programming Tutorial

3.8K views on YouTube

In this video we explain why l + (r – l) / 2 [or start + (end – start) / 2] is a better way to calculate the middle of two indexes of an array in C, compared to using (l + r) / 2 [or (start + end) / 2], because the first approach is less prone to integer overflow errors than the second the approach. Source code: https://github.com/portfoliocourses/c-example-code/blob/main/middle_index.c. Check out https://www.portfoliocourses.com to build a portfolio that will impress employers!