Luciana Murimilucianamurimi.hashnode.dev·Oct 28, 2024Linked ListsA linked list is a linear data structure consisting of nodes. Each node contains a data element and a reference to the next node in the sequence. Linked lists are implemented using objects. // Definition of a Linked List Node. class Node { con...#linkedlists
Raicode.flatmarstheory.com·May 30, 2024Mastering Memory Management in CIn the realm of modern computing, where artificial intelligence (AI) and supercomputers are pushing the boundaries of what's possible, the importance of secure and efficient programming practices cannot be overstated. One foundational aspect that und...32 readsbuffer overflows
Jyotiprakash Mishrablog.jyotiprakash.org·May 15, 2024DSA: Basics of Recursion, Pointers, and Dynamic AllocationRecursion in C Recursion in C is a technique where a function calls itself in order to solve a problem. Each time the function calls itself, a new stack frame is created for that call, containing its own set of local variables. This continues until a...33 likes·1.1K readsDSA
Aryan Kspaciouscoder78.hashnode.dev·Mar 11, 2024Dynamic Memory Allocation in C Using malloc()C is a very old language, with its existence dating back to 1970s. It has been the most influential language in the world with pretty much everything around us. Our Operating systems, routers and many other devices run using C. Despite being that inf...ProgrammingC
Jyotiprakash Mishrablog.jyotiprakash.org·Dec 28, 2023Bigger Example 3: Dynamic ArrayQuestion: Implement a dynamic array data structure in C that supports the following operations: Initialization with an initial capacity. Accessing an element at a given index. Setting the value at a given index. Inserting a new element at a speci...C Programmingarray
Jyotiprakash Mishrablog.jyotiprakash.org·Dec 27, 2023Basic Dynamic Memory Allocation Programming QuestionsHere are 10 C programming exercises that involve dynamic memory allocation: Dynamic Array: Create a program that dynamically allocates memory for an array of integers. Allow the user to input the size of the array and elements, and then print the ar...1.3K readsC Programmingdynamic memory allocation
Jyotiprakash Mishrablog.jyotiprakash.org·Dec 24, 2023Build your arrays differently too!In C, there are different ways to initialize arrays, both for single-dimensional and multi-dimensional arrays. Let's go through examples for both: Single-dimensional arrays: Method 1: Initializing at declaration: #include <stdio.h> int main() { ...42 readsC Programmingarray
Jyotiprakash Mishrablog.jyotiprakash.org·Dec 24, 2023Where do your variables live?Let's discuss stack and heap memory allocation in C with some sample code. Stack Allocation: Stack memory is used for storing local variables and function call information. The compiler automatically manages it. #include <stdio.h> // when stackEx...28 readsC Programmingstack
Jyotiprakash Mishrablog.jyotiprakash.org·Dec 15, 2023Need more memory? Dynamic memory to the rescue!In C, a program can obtain memory at runtime through a process called dynamic memory allocation. This is crucial when you need to allocate memory for data whose size changes while the application is running or when the quantity of memory required is ...162 readsC Programmingdynamic memory allocation
Maxwell Nana Forsonblog.lzcorp.tech·Nov 25, 2023Freeing Dynamic Memory the Right WayIf you have experience working with the C programming language, you understand the importance of managing memory properly to prevent memory leaks. This comes after dealing with various memory-related errors, such as segmentation faults. In this post,...12 likes·390 readsdynamic memory allocation