If I pass the following code through my GCC 4.7 snapshot, it tries to copy the unique_ptrs into the vector. #include <vector> #include <memory> in
I'm wondering whether situation exists where casting is completely necessary. I'm talking here about casts between classes, not basic types. Is casting (be it
I have an application which has several functions in it. Each function can be called many times based on user input. However I need to execute a small segment o
I have to find nth root of numbers that can be as large as 10^18, with n as large as 10^4. I know using pow() we can find the nth roots using, x = (long int)(1
I'm starting to write a video poker program and I'm running into some issues. I have a Hold function as you can see below: void Game::Hold( bool& choice
I've a very basic Linux script (/home/scripts/script.sh): #!/bin/bash echo 'a' | /bin/netcat -vv 10.10.10.1 3333 echo "done" > /tmp/result When I try to r
I know I can change the cursor by "setCursor(const QCursor &)". Now I want to change it by using qss, but I don't know how to do it. QWidget has the cursor
I have this code that doesn't work, but I think the intent is clear: testmakeshared.cpp #include <memory> class A { public: static ::std::shared_pt
I found that --suppress=unmatchedSuppression only suppresses unmatched suppression types in cppcheck options, but NOT unmatched inline suppressions. Is this t
i already know java, c++ (no one framework for GUI development) and little of c# (winforms for gui development) but i'm thinking to ivest my f
I'm programming a Chinese software, and embed some of the strings in the source file. To reduce runtime overhead (well, actually this is premature optimization,
I want to make two classes: an object and an object_manager, but I'm confused about how they should see/include each other. I've heard that it's forbidden for t
This is a ROS2 beginner question I've tried to use several ROS sources which suggested me to include "std_msgs/Int8MultiArray.h". However, if I do that I will g
I ask because I am using the Box2D library, which calls for mostly float arguments. Although I see a lot of example code that uses the 0.00f format, I am not qu
Why do constant references not behave the same way as constant pointers, so that I can actually change the object they are pointing to? They really seem like an
What is the best way to restrict use of certain headers(features of the library itself) in certain Cpp files. And if it fails to follow the set rules, compilati
I understand as Set size of vector of vectors at run time describes, one can declare vector of vector as vector<vector<int> > ref; then resize t
Write a program that uses the function isPalindrome given in Example 6-6 (Palindrome). Test your program on the following strings: madam, abba, 22, 67876, 4
struct B { virtual void bar () {} virtual void foo () { bar(); } }; struct D : B { virtual void bar () {} virtual void foo () {} }; Now we call foo()
What is the difference between definition and instantiation? Sub-question: Are "variable definition" and "variable instantiation" the same? int x; The above