coderz.py

Keep Coding Keep Cheering!

Dynamic Memory Allocation

In the C programming language, the concept of dynamic memory allocation allows the programmer to allocate memory at runtime. Four functions in the stdlib.h header file allows for dynamic memory allocation in the C language. malloc() calloc() realloc() free() Function Description malloc() Allocates a single block of memory in response to a request. calloc() Allocates […]

April 5, 2022 | C | No comments

Error Handling in C

The response and recovery procedures from error conditions present in a software application are referred to as error handling. C programming does not provide direct error handling support, but as a system programming language, it does provide access at a lower level in the form of return values. In the event of an error, most […]

April 4, 2022 | C | No comments

File handling in C

File handling in C allows us to use our C program to create, update, read, and delete files stored on the local file system. A file can be subjected to the following operations: Making a new file Choosing an existing file to open Taking a page from the file Adding to the file removing the […]

April 3, 2022 | C | No comments

Pointers with function in c

We can create a pointer pointing to a function in the same way that we can create a pointer of any data type, such as int , char, or float. A function’s code is always stored in memory, which implies that the function has an address. We use the function pointer to get the memory […]

April 2, 2022 | C | No comments

Pointer operations

Just like any other data type, we can perform various arithmetic operations on pointers. All pointers int, float, long, and double are 2 bytes on a 16-bit machine. When we perform any arithmetic function, such as increment on a pointer, the size of their primitive data type changes. Remember the following data type storage sizes […]

April 2, 2022 | C | No comments

Pointer to Pointer in C

A pointer variable stores the address of another pointer variable; this is referred to as a pointer to a pointer variable in C. It is a type of multiple indirections, also known as a chain of pointers. A pointer contains the address of a variable, and when a pointer to a pointer is defined, the […]

March 31, 2022 | C | No comments

Pointer to structure

The structure pointer points to the memory block address where the Structure is stored. It’s used to make complex data structures like linked lists, trees, and graphs. The structure’s members can be accessed using an arrow operator (->). we can declare a struct pointer in the following manner: here, *p represents the pointer. Accessing is […]

March 28, 2022 | C | No comments

Introduction to Singly Linked List

Singly Linked List Singly Linked List is a linear and connected data structure made of Nodes. Each node is composed of a variable data where its content (actual value) is stored and a pointer to the next Node (next node location) on the list. The Linked List has a pointer to the first element of this Node […]

March 27, 2022 | Data Structure | No comments

Pointer to array

An array name is a constant pointer to the array’s first element. As a result, in the declaration marks is a pointer to &marks[0], which is the address of the array marks’s first element. As a result, the following program fragment assigns p as the address of the element of the first marks. After storing […]

March 27, 2022 | C | No comments

Pointer in C

In C, a pointer is a variable that stores the address of another variable. This variable can be of any type, including int, char, array, function, or pointer. The pointer’s size is determined by the architecture. However, in 32-bit architecture, a pointer is 2 bytes in size. Pointer Notation Consider the declaration, This declaration tells […]

March 26, 2022 | C | No comments

Advertisement