What do you want to save?
Add Code snippet
New code examples
-
C 2021-11-11 10:09:34
how to check the size of a file in linux c
If you have the file stream (FILE * f): fseek(f, 0, SEEK_END); // seek to end of file size = ftell(f); // get current file pointer fseek(f, 0, SEEK_SET); // seek back to beginning of file // proceed with allocating memory and reading the file Or, #incl... Add solution -
Java 2021-11-11 04:43:22
arraylist length java
import java.util.ArrayList; /* * Java Program to find the length of ArrayList. * */ public class ArrayListDemo{ public static void main(String[] args) { System.out.println("Welcome to Java Program to find the length of array list"); ... Add solution -
C++ 2021-11-10 19:58:11
how to use vectors c++
#include <iostream> #include <vector> using namespace std; int main() { //vector element size const int size = 4; //vector with int data type //all elements are equal to 4 vector<int> myVect (size, 4); for (int i=0; i<s... Add solution -
C++ 2021-11-10 00:37:09
delete custome index from array c++
const int SIZE = 9; int arr[SIZE]; cout << "Enter numbers: \n"; for (int i = 0; i < SIZE; i++) cin >> arr[i]; for (int i = 0; i < SIZE; i++) cout << arr[i] << "\t"; cout << endl; cout &l... Add solution -
Other 2021-11-09 19:39:29
huffman coding algorithm code
// Huffman Coding in C++ #include <iostream> using namespace std; #define MAX_TREE_HT 50 struct MinHNode { unsigned freq; char item; struct MinHNode *left, *right; }; struct MinH { unsigned size; unsigned capacity; struct MinHNode **... Add solution -
C++ 2021-11-09 19:30:20
how to delete repeated element in stack c++
int* stack = (int*)malloc(10 * sizeof(int)); int size = 10; int sp = -1; bool isempty() { return (sp == -1); } bool isfull() { return (sp == size - 1); } void push(int x) { if (isfull()) { printf("Full!"); } else {... Add solution -
C++ 2021-11-09 06:50:09
print a 3d vector in c++
// A recursive function able to print a vector // of an arbitrary amount of dimensions. template<typename T> static void show(T vec) { std::cout << vec; } template<typename T> static void show(std::vector<T> vec) { int size =... Add solution -
Java 2021-11-07 06:34:22
java list length
import java.util.ArrayList; /* * Java Program to find the length of ArrayList. * */ public class ArrayListDemo{ public static void main(String[] args) { System.out.println("Welcome to Java Program to find the length of array list"); ... Add solution