Declaration of Structures

To declare a structure you must start with the keyword struct followed by the structure name or structure tag and within the braces the list…

Structures in C

A structure is commonly referred to as a user-defined data type. C’s structures allow you to store multiple variables of any type in one place…

Call by Value

In many functions, we passed arguments to them, but if we observe carefully, we will see that we have always created new variables for arguments…

Recursion

Within a function body, if the function calls itself, the mechanism is known as ‘Recursion’ and the function is known as ‘Recursive function’. Now let us study this…

Types of function invoking

We categorize a function’s invoking (calling) depending on arguments or parameters and their returning a value. In simple words, we can divide a function’s invoking…

Register Variables

Besides three storage class specifications namely, Automatic, External and Static, there is a register storage class. Registers are special storage areas within a computer’s CPU….

Static Variables

In the case of single file programs static variables are defined within functions and individually have the same scope as automatic variables. But static variables retain their…

External (Global) Variables

Global variables are not confined to a single function. Their scope ranges from the point of declaration to the entire remaining program. Therefore, their scope may…

Automatic Variables

The variables local to a function are automatic i.e., declared within the function. The scope of lies within the function itself. The automatic defined in different functions,…

Types of Variables and Storage Classes

In a program consisting of a number of functions, a number of different types of variables can be found. Global vs. Static variables Global variables…

The Return Statement in C

If a function has to return a value to the calling function, it is done through the return statement. It may be possible that a function does…

Function Prototypes in C

Function Prototypes require that every function which is to be accessed should be declared in the calling function. The function declaration, that will be discussed…

Function Argument in C Language

A function in C can be called either with arguments or without arguments. These function may or may not return values to the calling functions. All C functions can be called either with arguments or without arguments in a C program. When a…

Function declaration in C

Function declaration in C – Every function has its declaration and function definition. When we talk of declaration only, it means only the function name, its…

Functions in C Programming Language

Functions in C Language – To make programming simple and easy to debug, we break a larger program into smaller subprograms which perform ‘well defined…

String Functions in C Language

The header file <string.h> contains some string manipulation functions. The following is a list of the common string managing functions in C. Strlen( ) The…

Array of strings in C Language

  An array of strings are multiple strings, stored in the form of the table. Declaring an array of strings is same as strings, except…

String Formatting in C Language

  The printf function with %s format is used to display the strings on the screen. For example, the below statement displays entire string: printf(“%s”,…

String Constants in C Language

String constants have double quote marks around them and can be assigned to char pointers. Alternatively, you can assign a string constant to a char…

Initialization of Strings in C Language

The string can be initialized as follows: char name[ 8] = {‘P’, ‘R’, ‘O’, ‘G’, ‘R’, ‘A’, ‘M’, ‘\0’};   Each character of string occupies…