Category: 02. C
-
Pointer Arithmetics in C
A pointer variable in C stores the address of another variable. The address is always an integer. So, can we perform arithmetic operations such as addition and subtraction on the pointers? In this chapter, we will explain which arithmetic operators use pointers in C as operands, and which operations are not defined to be performed…
-
Applications of Pointers in C
One of the most important features of C is that it provides low-level memory access with the concept of pointers. A pointer is a variable that stores the address of another variable in the memory. The provision of pointers has many applications such as passing arrays and struct type to a function and dynamic memory allocation, etc.…
-
Pointers and Arrays in C
In C programming, the concepts of arrays and pointers have a very important role. There is also a close association between the two. In this chapter, we will explain in detail the relationship between arrays and pointers in C programming. Arrays in C An array in C is a homogenous collection of elements of a…
-
Pointers in C
Pointers in C are easy and fun to learn. Some complex C programming tasks can be performed more easily with pointers, while some other tasks such as dynamic memory allocation cannot be performed without using pointers. So it becomes necessary to learn pointers to become a perfect C programmer. With pointers, you can access and…
-
Variable Length Arrays in C
variable length array in C is also called a variable-sized or runtime-sized array. It is an array whose length is determined at the runtime rather than at the time of compiling the program. Its size depends on a value generated during the runtime of a program, usually received as an input from the user. Usually,…
-
Return an Array from a Function in C
Functions in C help programmers to apply modular program design. A function can be defined to accept one or more than one arguments but it can return a single value to the calling environment. However, the function can be defined to return an array of values. In C, a function can be made to return…
-
Passing Arrays as Function Arguments in C
If you want to pass an array to a function, you can use either call by value or call by reference method. In “call by value” method, the argument to the function should be an initialized array. Here, an array of fixed size equal to the size of the array to be passed. In “call by reference” method, the…
-
Multi-dimensional Arrays in C
The array is declared with one value of size in square brackets, it is called one dimensional array. In a one dimensional array, each element is identified by its index or subscript. In C, you can declare with more indices to simulate a two, three or multidimensional array. Multidimensional Arrays in C Multi-dimensional arrays can…
-
C – Properties of Array
Arrays are a very important data structure in C. Use of array in C program makes it easier to handle large amount of data. Arrays have a number of advantages over singular variables as a result of their number of properties. Most of the important properties of array are a result of its composition −…
-
Arrays in C
Arrays in C are a kind of data structure that can store a fixed-size sequential collection of elements of the same data type. Arrays are used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type. What is an Array…