Linked list in C is List which is a collection of elements. There are two ways of maintaining a list in computer memory. The first way is to take an array for sorting the elements of the list, but arrays have some disadvantages. Insertion and deletion of an element from an array requires more processing. If the number of elements in the list is less than the size of array then memory will be wasted and if the number of elements exceed the size of array then also we will have problem. The second way of implementing a list in…
Dynamic Memory Allocation in C is the memory allocation that we have done till now was static memory allocation. The memory that could be used by the program was fixed that is we could not allocate or deallocate memory during the execution of the program. In many application it is not Possible to predict how much memory would be needed by the program at run time.
For example we declare an array of integer of size 200.
In an array, it is must to specify the size of array while declaring, so the size of this array will…
Pointer is C is to makes the code more efficient and compact. C is a very powerful language and the real power of C lies in pointers. Pointer is also a variable which will hold the address of other variable for which it is declared.
The General format is — Data_type *pv;
Example :- int *p;
where p is pointer variable which will hold the address of integer variable.
Some of the user of pointers are:
Structure in C is a collection if more than one variable which may be same type or different type.
To declare a structure we use a keyword structure:
The genral format is:
Operators in C Programming Specifies and operation to be performed that yields a value. The variable, constant can be joined by various operators to form an expression. An operand is a data item on which an operator acts. Some operators require two operands, while others act upon only one operand.
C includes a large number of operators that fall under several different categories, Which are :-
Arithmetic Operators : Arithmetic Operators are used for numeric Calculations.
They are of two…
In C there is no separate data type for string. String in C is treated as arrays of type char. Character in array is a string if it ends with null character, that null character is an escape sequence with ASCII value 0 and it is different from the ASCII character ‘0’. String is generally used to store and manipulate data in text form like words or sentences.
String constant is a sequence of characters enclosed in double quotes and is also called a literal. The double quotes are not a part of the string.
“Welcome To C…
Variable in C is used to give storage to a specific name. Variable are declared with a body or outside the body.
There are three types of variable used in C Programming:
Local Variable gets temporary memory allocation. The scope and visibility of local variable is restricted inside the function block where it is declared. The lifetime of local variable is equal to the lifetime of function.
According to parameter and return type a function can be categorized in four types of Function.
No arguments no return : A Functionwill not accept any value as an arguments and also not return any value. Normally in this type for function we write void as a return type and parenthesis will be empty.
Function in C is a object which has certain functionality to perform a particular task. It is block of statement which perform task.
There are two types of function:
Pre-defined Function : Pre-defined functions are already defined and ready made available for use although we can use any predefined function but before using it we must include Header files.
Header files contains definitions of related functions
C provides several types of Header files, some common Header files are :-
Stdio.h :- This header files contains various standard input output functions like Printf, scanf, etc.
Array in C is a collection of similar type of data items and each data items is called an element of the array. Data types of an elements may be any valid data types like char, int or float. Elements of array share the same variable name but each elements has a different index number known ad subscript.
Array can be single dimensional or multidimensional. The number of subscripts determines the dimension of array. A one dimensional array has one subscript, two dimensional array has two subscripts and so on. …