Some of the interesting features of the C Language

Some of the interesting features of the C Language

Here in this article we are listing out few of the interesting features with the C language. Some of the points listed out here are not used normally during the implementation of a production code. But these tips are worthy of noting down. The more we understand the C language the more confident we would become in coding with this magnificent language.

The features listed out below will be updated and added with more information and points going forward. Also feel free to post your views as comments to this article..

So let’s start with….  🙂

 

1. Function called with multiple arguments

In C if a function definition does not specify any parameters, then this function can be called with any number of arguments or without any. For example, see the below sample code:

2. The terms “parameters” and “arguments”

The term ‘parameter’ refers to any declaration within the parentheses following a function name in a function declaration or definition; the term ‘arguments’ refers to any expression within the parentheses of a function call.

3. Order of evaluation of function parameters

There is no guarantee about the evaluation of the order of the function parameters in C. The order of evaluation is purely implementation dependent, so while writing programs we should not use expressions which can cause side-effects. This would be better explained with the below example:

In the above example, the result values of x and y will be implementation dependent.

4. Multiple declaration of global variable

C allows a global variable to be declared multiple times; having said so, there should only be one definition for the variable. See the below example:

Here in the above example you will be getting the answer as 10.
But if you try to re-declare a local variable, then you would be getting the redeclaration of ‘x’ with no linkage error during compilation.