> <i>Everything we've seen here is still normal C, but often we want to associate a function with a type. For instance, the area function we have shown above only works with rectangles, but what if we had circles as well? We'd end up with two functions, one called area_rectangle and one called area_circle.</i><p>This is not to call the article into question but only to show that C11 does support generics, allowing for:<p><pre><code> printf("Rectangle area: %.2f\n", area(rect));
printf("Circle area: %.2f\n", area(circle));
</code></pre>
Full code here:<p><a href="https://gist.github.com/williamcotton/a8f429e891cbba5abfadcc0a929dda00" rel="nofollow">https://gist.github.com/williamcotton/a8f429e891cbba5abfadcc...</a>