Category: C Programming

Complete Guide On Using Doxygen To Document C Source Code..!!

As we know Doxygen is a very powerful tool to do documentation, but it’s more geared toward object-oriented languages like C++ and Java. The Doxy wizard, a.k.a. the GUI frontend of Doxygen, has so many options to play with and in this article, I am going to show you how to optimize the settings to wield the full power of Doxygen to document source code written in C. I have written this article keeping beginners in mind. First, let’s see how Doxygen works, then let’s see how to write Doxygen compatible comments and then proceed to see how to install...

macro functions cover

C: Macro Functions vs Regular Functions vs Inline Functions Part#2

So just to recap what we saw in part 1 of this blog Regular functions are better at Readability and Code size while Macro functions are better at code performance. In this part let’s have a look at inline functions and see how and where to use them and how good of a replacement to a macro function they are. Inline Functions This is the last piece of the puzzle. Inline functions originally came in C++ and later in c99 update, it was added to the C programming language. So now in C, we have the ability to use the“inline”...

macro functions cover

C: Macro Function vs Regular Function vs Inline Functions

If you have some experience with C programming and you have had the opportunity to look at some library code then you must have seen something like this The above construct can be called as a macro function or a smart macro. If this code is executed we would get the same result as if ADD is a regular function like in the code listing below. When I was looking at these macro functions I had several questions pop up in my head. Are macros better than normal functions? If so why don’t we use macro functions everywhere? What is...