What do you want to save?
Add Code snippet
New code examples
-
C++ 2021-10-28 02:21:11
heap sort internal implementation using c++
Implementation of heap sort in C: #include <stdio.h> int main() { int heap[10], array_size, i, j, c, root, temporary; printf("\n Enter size of array to be sorted :"); scanf("%d", &array_size); printf("\n Ent... Add solution -
C++ 2021-10-27 21:04:05
error: use of parameter outside function body before ] token c++, 2D array in c++
If you are using GCC, then you are to pass the length of the array as a parameter to the function. void foo (int m, int arr[][m]) { //... } However, there seems to be a bug in either the compiler or the documentation, as the above function prototype ... Add solution -
C++ 2021-10-27 12:30:08
how to define range of numbers inside a if condition in c++
template <int min, int max> class range { static bool contains(int i) { return min <= i && i < max; } // In C++, ranges usually are half-open. }; int age = 23; if (range<18,30>::contains(age)) { //Your desired code } Add solution -
C++ 2021-10-27 09:34:14
how to define function prototypes in c++
/* C++ Function Prototype and C++ Function Definition */ #include<iostream.h> #include<conio.h> #include<stdlib.h> int add(int, int); // function prototype int subtract(int, int); // function prototype int multiply(int, int)... Add solution -
Other 2021-10-27 03:50:15
windows.h
windows.h is a Windows-specific header file for the C and C++ programming languages which contains declarations for all of the functions in the Windows API, all the common macros used by Windows programmers, and all the data types used by the various f... Add solution -
C++ 2021-10-26 22:41:10
Write a c++ program that reads a sentence (including spaces) and a word, then print out the number of occurrences of the word in the sentence
Write a c++ program that reads a sentence (including spaces) and a word, then print out the number of occurrences of the word in the sentence Add solution -
Javascript 2021-10-26 20:46:14
nodejs restart process
Generally process managers are used to (automatically) restart processes, such as monit, PM2, nodemon, forever, etc. However, you could restart from the process itself by simply spawning a detached child process that waits some period of time and then ex... Add solution -
C++ 2021-10-25 20:14:06
binary search tree in cpp using class
/* Program to implement Binary Search Tree in c++ using classes */ #include<iostream> #include<stdlib.h> #include<cstdlib> using namespace std; struct Node { int data; Node* left; Node* right; }; class BinaryTree { pri... Add solution