What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-09 03:30:05
WAP to read and print ‘n’ student details using structure and Dynamic Memory Allocation.
/*C program to read and print the N student details using structure and Dynamic Memory Allocation.*/ #include <stdio.h> #include <stdlib.h> /*structure declaration*/ struct student { char name[30]; int roll; float perc; }; i... Add solution -
C++ 2021-10-08 21:54:10
malloc c++ example
#include <iostream> #include <cstdlib> using namespace std; int main() { int *ptr; ptr = (int*) malloc(5*sizeof(int)); if(!ptr) { cout << "Memory Allocation Failed"; exit(1); } cout << "Initializing value... Add solution -
-
C 2021-09-30 23:20:05
deallocate memory in c
// Use malloc to allocate memory ptr = (castType*) malloc(size); int *exampl = (int*) malloc(sizeof(int)); // Use calloc to allocate and inizialize n contiguous blocks of memory ptr = (castType*) calloc(n, size); char *exampl = (char*) calloc(20, sizeof(c... Add solution -
Other 2021-09-30 06:18:05
binary search tree
// Binary Search Tree operations in C #include <stdio.h> #include <stdlib.h> struct node { int key; struct node *left, *right; }; // Create a node struct node *newNode(int item) { struct node *temp = (struct node *)malloc(sizeof(struc... Add solution -
Other 2021-09-27 15:05:02
write a function that will concatenate two circular linked list producing one circular linked list
#include <stdio.h> #include <stdlib.h> struct node { int data; struct node *next; }; struct node *even = NULL; struct node *odd = NULL; struct node *list = NULL; //Create Linked List void insert(int data) { // Allocate memory for n... Add solution