What do you want to save?
Add Code snippet
New code examples
-
C 2021-10-16 12:09:12
Segment tree
// C++ program to show segment tree operations like construction, query // and update #include <bits/stdc++.h> using namespace std; // A utility function to get the middle index from corner indexes. int getMid(int s, int e) { return s + (e -s)... Add solution -
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-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-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 -
Other 2021-09-26 07:17:11
CreateThread
#include <windows.h> #include <tchar.h> #include <strsafe.h> #define MAX_THREADS 3 #define BUF_SIZE 255 DWORD WINAPI MyThreadFunction( LPVOID lpParam ); void ErrorHandler(LPTSTR lpszFunction); // Sample custom data structure for threa... Add solution -
C 2021-09-24 18:41:03
insertion singly linked list in c
/** * C program to insert a new node at the beginning of a Singly Linked List */ #include <stdio.h> #include <stdlib.h> /* Structure of a node */ struct node { int data; // Data struct node *next; // Address }*head; v... Add solution -
Other 2021-09-20 14:06:02
Remove all the vowels from a given string using pointers concept
#include<stdio.h>#include<stdlib.h>#include<string.h>#define TRUE 1#define FALSE 0 int check_vowel(char); main(){ char string[100], *temp, *pointer, ch, *start; printf("Enter a string\n"); gets(string); temp = string;... Add solution -
C++ 2021-09-14 18:46:02
joining two vectors in c++
// my linkedin : https://www.linkedin.com/in/vaalarivan-prasanna-3a07bb203/ vector<int> AB; AB.reserve(A.size() + B.size()); // preallocate memory AB.insert(AB.end(), A.begin(), A.end()); AB.insert(AB.end(), B.begin(), B.end()); //eg : A = {4, 1}, B... Add solution -
C 2021-09-11 08:23:04
reverse a singly linked list in c
/** * C program to reverse a Singly Linked List */ #include <stdio.h> #include <stdlib.h> /* Structure of a node */ struct node { int data; //Data part struct node *next; //Address part }*head; /* Functions used in the program *... Add solution