What do you want to save?
Add Code snippet
New code examples
-
C 2021-10-28 16:15:10
two bytes to int c
// bytes_to_int_example.cpp // Output: port = 514 // I am assuming that the bytes the bytes need to be treated as 0-255 and combined MSB -> LSB // This creates a macro in your code that does the conversion and can be tweaked as necessary #define byte... Add solution -
C++ 2021-10-28 10:43:11
How to read a file in in C++
// io/read-file-sum.cpp - Read integers from file and print sum. // Fred Swartz 2003-08-20 #include <iostream> #include <iomanip> #include <fstream> using namespace std; int main() { int sum = 0; int x; ifstream inFile; ... Add solution -
C 2021-10-28 03:26:14
undefined reference to `cv::VideoCapture::VideoCapture(cv::String const&)'
prashad@ubuntu:~/test$ g++ open_videofile.cpp `pkg-config --cflags --libs opencv` Explanation: need to compile opencv programs with `pkg-config --cflags --libs opencv` . it solve below undefined reference errors: undefined reference to `cv::VideoCap... Add solution -
C++ 2021-10-25 03:34:11
c program to right shift a string by 2 numbers
/*c,cpp program to right shift a string by n positions (may be 1right, 2right, etc.)*/ #include <string> using namespace std; void main() { string str="apple"; int shift; cout<<"Enter the number of shifts for the string... Add solution -
-
Other 2021-10-23 19:43:11
code runner not executing program name with spaces
"code-runner.executorMap": { "cpp": "cd $dir && g++ \"$fileName\" -o \"$fileNameWithoutExt.exe\" && & \"$dir$fileNameWithoutExt.exe\"" } Add solution -
C++ 2021-10-22 14:57:07
operator overloading in c++ example
// money.h -- define the prototype class Money { public: Money & operator += (const Money &rhs); } // money.cpp -- define the implementation Money& Money :: operator += (const Money &rhs) { // Yadda Yadda return *this; } Add solution -
C++ 2021-10-22 08:33:21
how to make a Loop in c++
//'i' can be any number //Can be any comparison operater //can be any number compared //can be any mathmatic operater for (int i = 0; i<100; i++){ //Do thing } //more info on operaters //https://www.w3schools.com/cpp/cpp_operators.asp Add solution