What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-03-22 13:25:16
arrow operator c++
/* the arrow operator is used for accessing members (fields or methods) of a class or struct it dereferences the type, and then performs an element selection (dot) operation */ #include <iostream> using std::cout; class Entity { public: con... Add solution -
C++ 2022-03-18 18:00:09
basic data types in c++ hackerrank solution
#include <iostream> using std::cin; using std::cout; using std::endl; using std::fixed; int main() { int a; long b; char c; float d; double e; cin>>a>>b>>c>>d>>e; cout<<a<<endl; cout<<... Add solution -
C++ 2022-02-02 17:45:33
array declaration c++
#include <iostream> using std::cout; int a[] = { 1, 2, 3, 4, 5 }; int counta() { return sizeof( a ) / sizeof( a[ 0 ] ); // works, since a[] is an array } int countb( int b[] ) { return sizeof( b ) / sizeof( b[ 0 ] ); // fails, since b[... Add solution -
Other 2021-11-02 21:46:05
c++ sha256
/*************************************************************************** C++ sha256 function SHA-256 is the most popular hash function in the SHA-2 family at the time of writing. It provides 128 bits of security for digital signatures and hash-only ... Add solution -
C++ 2021-10-30 05:34:10
pointers to pointers in cpp
#include <iostream> using std::cout; int main() { /* Some things to keep in mind: -you shouldn't circumvent the type system if you are creating raw ptrs and don't need to "type pun" or cast (don't use void ptrs) -ptr types ... Add solution -
TypeScript 2021-10-18 06:57:10
number of elements in c++ array
#include <iostream> using std::cout; int a[] = { 1, 2, 3, 4, 5 }; int counta() { return sizeof( a ) / sizeof( a[ 0 ] ); // works, since a[] is an array } int countb( int b[] ) { return sizeof( b ) / sizeof( b[ 0 ] ); // fails, since b[... Add solution -
C++ 2021-09-29 21:03:07
read char from text file c++
#include <iostream> #include <fstream> #include <vector> using std::cout; using std::cerr; using std::endl; using std::string; using std::ifstream; using std::vector; int main() { string filename("input.txt"); vector&... Add solution -
C++ 2021-09-29 04:48:02
how to read wav file in C++
#include <iostream> #include <string> #include <fstream> #include <cstdint> using std::cin; using std::cout; using std::endl; using std::fstream; using std::string; typedef struct WAV_HEADER { /* RIFF Chunk Descriptor */ ... Add solution