logo
down
shadow

CPP QUESTIONS

Threaded Video Player sync
Threaded Video Player sync
it fixes the issue Disclaimer:I asked this question a few days ago on codereview,but got no answer.Here I change the question format from review request to a specific problems. , Any suggestion of a better design?
TAG : cpp
Date : November 24 2020, 01:01 AM , By : user2957566
Does infinite of floating point number satisfy these equation?
Does infinite of floating point number satisfy these equation?
I wish did fix the issue. All the expressions 1-7 in your question evaluate to true when compiled by a compiler that implements IEEE 754 rules. None of them depend on the rounding mode. For many, this is simply because < and == are exact operations.
TAG : cpp
Date : November 24 2020, 01:01 AM , By : user2957556
map sorting in c++ by the frequencies
map sorting in c++ by the frequencies
help you fix your problem I encorage you to think a little differently about this problem.While you currently have a map, i suggest that (atleast for doing this task) to extract the key value pairs.
TAG : cpp
Date : November 24 2020, 01:01 AM , By : user2957504
The Preprocessor program linked in g++ similar to the cpp program in gcc
The Preprocessor program linked in g++ similar to the cpp program in gcc
this one helps. At the preprocessing level, there isn't much difference between the two languages. It's just a matter of telling the preprocessor how to resolve includes (i.e. telling it the correct include paths) and defining certain macros (like __
TAG : cpp
Date : November 24 2020, 01:01 AM , By : user2957489
How is the union used in this OpenCV library?
How is the union used in this OpenCV library?
hope this fix your issue Here, rows means "number of rows", which is essentially the same as height. Similarly, cols means "number of columns" and is just an alias for width. They are not necessarily aliases in other contexts, but as far as OpenCV is
TAG : cpp
Date : November 24 2020, 01:01 AM , By : user2957463
C++ memory leak in recursion
C++ memory leak in recursion
hop of those help? Replace ** with vectors and avoid using calloc, malloc, new and delete.
TAG : cpp
Date : November 24 2020, 01:01 AM , By : user2957435
C++ Error: C4430 and C2143 Error at an impossible place
C++ Error: C4430 and C2143 Error at an impossible place
I hope this helps . I tried to search the answer to this error on the internet, but the problem always seems to be that someone forgot to add the return specifier int to the main function. It's weird, because the error is thrown on a line where nothi
TAG : cpp
Date : November 23 2020, 01:01 AM , By : user2957369
How can I track object lifetime in C++11 lambda?
How can I track object lifetime in C++11 lambda?
I wish did fix the issue. Extend object lifetime Lambdas can capture shared pointers to this, so an object won't die while at least one lambda exists.
TAG : cpp
Date : November 23 2020, 01:01 AM , By : Design Orchard
#include statement mapping in Biicode (biicode.conf)
#include statement mapping in Biicode (biicode.conf)
should help you out The [includes] section prepends the right part to the left side in case that the left side pattern match the file name. In your case, the last folders are not necessary. Try instead:
TAG : cpp
Date : November 23 2020, 01:01 AM , By : user2957313
std::equal gives "Term doesnt evaluate to a function taking 2 arguments"
std::equal gives "Term doesnt evaluate to a function taking 2 arguments"
it fixes the issue See the referenceYou're trying to use the overload std::equal which takes 4 iterators, which only exists in C++14. It doesn't exist in older versions, hence the confusing error because of using the "3 iterators and a predicate" ove
TAG : cpp
Date : November 23 2020, 01:01 AM , By : user2957294
C++ template argument as reference lvalue
C++ template argument as reference lvalue
will be helpful for those in need Floating point types cannot be non-type template parameters. Thus the author of the template took a reference to a double instead.Your code has two problems. First of all, an argument to such a reference must have st
TAG : cpp
Date : November 23 2020, 01:01 AM , By : Rebeca
Legal to forward declare C standard library entities but not C++ standard library entities?
Legal to forward declare C standard library entities but not C++ standard library entities?
I wish this help you The problem is that C++ and C are not compatible at the object level... For example it's different to write:
TAG : cpp
Date : November 23 2020, 01:01 AM , By : user2957234
Conversion of wchar_t* to string
Conversion of wchar_t* to string
To fix this issue How can I convert an wchar_t* array to an std::string varStr in win32 console. , Use wstring, see this code:
TAG : cpp
Date : November 23 2020, 01:01 AM , By : user2957231
VirtualTreeView - Embarcadero C++ Builder XE7 - 64 bits
VirtualTreeView - Embarcadero C++ Builder XE7 - 64 bits
I wish this help you I just downloaded the latest version from the VirtualTree from here: https://virtual-treeview.googlecode.com/svn/trunk.Since the designtime package doesn't have a 64 bit configuration (Which makes sense because the IDE is a 32 bi
TAG : cpp
Date : November 23 2020, 01:01 AM , By : user2957222
I don't understand C++ pointer arithmetic
I don't understand C++ pointer arithmetic
will be helpful for those in need The output is not strange, it is to be expected: You have three variables in main(), all of which are stored on the stack, and which happen to be right one after the other. One of these variables is the pointer itsel
TAG : cpp
Date : November 23 2020, 01:01 AM , By : user2957218
Invalid addition of constness? Error: Cannot use char** to initialize const char**
Invalid addition of constness? Error: Cannot use char** to initialize const char**
With these it helps This is an age-old problem, whereby intuitively you think you can "add constness", but in fact adding constness indirectly violates const-correctness.The standard itself even has an example of it to help set people back on the cor
TAG : cpp
Date : November 23 2020, 01:01 AM , By : user2957189
Initilize constructor of class from another class
Initilize constructor of class from another class
This might help you The problem is that A doesn't have a default constructor (because if you define another constructor and default one is not generated) and so A objects cannot be default constructed.The solution is to use constructor initialization
TAG : cpp
Date : November 23 2020, 01:01 AM , By : user2957148
what happens when a class object is used as an index for an array?
what happens when a class object is used as an index for an array?
I think the issue was by ths following , Your A class must have an operator int or operator size_t perhaps, defined. That operator is used to convert an instance of that class into an integral type, at which point regular array access takes place. Ex
TAG : cpp
Date : November 23 2020, 01:01 AM , By : tiago.costa
Read and straighten multiple images from vector string, get error: "vector subscript out of range" [c++]
Read and straighten multiple images from vector string, get error: "vector subscript out of range" [c++]
seems to work fine one of the problems in your code is, that you never check the results of your operations, there should be:
TAG : cpp
Date : November 23 2020, 01:01 AM , By : user2957101
Meaning of a few lines in C++
Meaning of a few lines in C++
I hope this helps you . A char* is typically used to point at the first element in an array of chars, where one of the chars in the array is \0 and denotes the end of a string. We refer to such char*s as C-style strings. That is, this type represents
TAG : cpp
Date : November 23 2020, 01:01 AM , By : Tinorberto
Map, pair-vector or two vectors...?
Map, pair-vector or two vectors...?
Any of those help If iteration needs to be fast, you don't want std::map: its iteration is a tree-walk which quickly gets bad. std::map is really only reasonable if you have many mutations to the sequence and you need the sequence ordered by the key.
TAG : cpp
Date : November 23 2020, 01:01 AM , By : CltGeek
Redefinition error in ostream overload in template and inherited classes
Redefinition error in ostream overload in template and inherited classes
this one helps. I am trying to overload the ostream operator in template and inherited classes and I have been following some tips here and here, but I get a redefinition error. Here is a reproduction of my code: , Replace
TAG : cpp
Date : November 22 2020, 03:03 PM , By : user2957045
CUDA 6.5: error MSB3191 Unable to create directory and LNK2001 Unresolved External symbol
CUDA 6.5: error MSB3191 Unable to create directory and LNK2001 Unresolved External symbol
will help you I am just reproducing the steps to resolve the errors: To resolve the error(temporary workaround): MSB3191: Unable to create directory The given path's format is not supported., simply copy Cuda cu and cuh files to Visual studio project
TAG : cpp
Date : November 22 2020, 03:03 PM , By : Conor
Is it possible to overlap batched FFTs with CUDA's cuFFT library and cufftPlanMany?
Is it possible to overlap batched FFTs with CUDA's cuFFT library and cufftPlanMany?
like below fixes the issue If you use Advanced Data Layout, the idist parameter should allow you to set any arbitrary offset between the starting points of 2 successive transform input sets.For the 1D case, the input will be selected according to the
TAG : cpp
Date : November 22 2020, 03:03 PM , By : meizaps
How to delete function from DLL binary
How to delete function from DLL binary
To fix the issue you can do I've got a compiled dll file (dll binary) without source code. I have to delete some functions from this dll. Dll is written in C++. , Friends, here is solution works for me. Solution
TAG : cpp
Date : November 22 2020, 03:03 PM , By : Àlex Bruch
How do I loop over a boost MPL list of non-default constructed classes?
How do I loop over a boost MPL list of non-default constructed classes?
it helps some times I've solved this by adding a type wrapper struct, like the one seen in Boost.Hana. I added this to the great idea found in this comment that mentions using boost::mpl::transform to add this wrapper type to each item in the list au
TAG : cpp
Date : November 22 2020, 03:03 PM , By : user2956953
Download page using IE engine + use POST
Download page using IE engine + use POST
should help you out You can try using WinINET's (wininet.dll) HttpOpenRequest function instead:http://msdn.microsoft.com/en-us/library/windows/desktop/aa384233(v=vs.85).aspx
TAG : cpp
Date : November 22 2020, 03:03 PM , By : user2956936
How to insert an element into ublas matrix with dynamic size
How to insert an element into ublas matrix with dynamic size
With these it helps As you have noticed yourself, boost::numeric::ublas::matrix doesn't resize itself automatically, like std::vector. You have to do the resizing manually before calling operator(), or write a function template that does the resizing
TAG : cpp
Date : November 22 2020, 03:03 PM , By : Kitteran
Using typedefs appropriately to avoid "typedef contamination"
Using typedefs appropriately to avoid "typedef contamination"
I wish this help you You can limit related typedef's in namespaces. You can put the typedef's being used in just 1 class into that class. If a typedef is used in just few files, add the typedef in .cpp file.
TAG : cpp
Date : November 22 2020, 03:03 PM , By : user2956850
C++ Simple Converting from Binary to Decimal
C++ Simple Converting from Binary to Decimal
I hope this helps you . In c++ you can copy structs, unions etc but can not copy arrays directly. Becuase of this reason, you can not return an array and assign it to another array.Instead of somearr[8] you can use std::array or std::vector. These st
TAG : cpp
Date : November 22 2020, 10:56 AM , By : user2956635
error deleting item from list after passing through function
error deleting item from list after passing through function
around this issue The error message is self-explanatory: at that point it is not a std::list::iterator, it's actually an std::list::iterator*. You must dereference the pointer (as you did just on the previous line).
TAG : cpp
Date : November 22 2020, 10:56 AM , By : Elliott Klein
C++: RVO, NRVO and returning local objects
C++: RVO, NRVO and returning local objects
Hope this helps I just read about RVO (Return Value Optimization) and NRVO (Named Return Value Optimization). Below are two examples , They are different.
TAG : cpp
Date : November 22 2020, 10:56 AM , By : user2956545
performance map c++ find (g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3))
performance map c++ find (g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3))
should help you out Answering my own questions as this problem might be occurring to other users as well. I was able to improve perf using the recommendations in the comments section of my question . @RetiredNinja suggested me to use boost unordered
TAG : cpp
Date : November 22 2020, 10:56 AM , By : user2956543
How to change the fundamental underlying container type for the adaptor containers?
How to change the fundamental underlying container type for the adaptor containers?
will help you I want to use stack, which uses list as a fundamental container and not vector. How can I do so? As I know by default the stack will use vector. How can I ensure that the stack will use only the container I have mentioned. For example,
TAG : cpp
Date : November 22 2020, 10:54 AM , By : user2956355
Crash when SAFE_RELEASE is called on IMMDeviceEnumerator
Crash when SAFE_RELEASE is called on IMMDeviceEnumerator
will be helpful for those in need Your code as posted does not crash, not even without unregistering the callback. Checked by copy-pasting what you have and adding what you didn't. The IUnknown methods are missing, but pretty unlikely to have anythin
TAG : cpp
Date : November 22 2020, 10:54 AM , By : user2956287
Visual Studio C++, how to change the text color for "nullptr"
Visual Studio C++, how to change the text color for "nullptr"
it helps some times Visual Studio doesn't allow you override keyword coloring feature. There is no direct way! However, It is possible by writing your own Syntax Colorizing plugin.Find more information here: Syntax Colorizing (Managed Package Framewo
TAG : cpp
Date : November 22 2020, 10:54 AM , By : user2956203
C++ , return string from function; boost::asio read / write
C++ , return string from function; boost::asio read / write
it fixes the issue I get a compile error, additionally I cannot boost::asio::read buf without giving it array elements. , The most generic way would be use a asio::streambuf
TAG : cpp
Date : November 22 2020, 10:54 AM , By : user2956167
C++ and finance, trouble understanding syntax in these files
C++ and finance, trouble understanding syntax in these files
To fix this issue I originally wasn't going to answer as there is a lot here for beginning c++ but I thought it might be beneficial to give you a highlevel overview and make you aware of the learning curve involved. I think you should slow things dow
TAG : cpp
Date : November 22 2020, 10:54 AM , By : nicola_alberts
Exception Handling in underflow while doing POP in Stack
Exception Handling in underflow while doing POP in Stack
it should still fix some issue I want to know how to apply exception handling when the top variable reaches to a value -1 (no element left to pop). Currently, I am using cout to nofity the user about the stack underflow and returning 0, which is not
TAG : cpp
Date : November 22 2020, 10:54 AM , By : user2956130
C++, Mongoose: How to make a POST request?
C++, Mongoose: How to make a POST request?
Does that help Okay, it turns out I was thinking about this wrong. I needed to respond to the POST request I was getting. So using mg_printf_data(...) with the connection object worked for me.
TAG : cpp
Date : November 22 2020, 10:54 AM , By : gianfratti
boost split method results in iterator error
boost split method results in iterator error
With these it helps boost::is_any_of takes a sequence (e.g. a string), not a single element (e.g. a char). The functor it produces returns true on a match with any one of the elements in the passed sequence.
TAG : cpp
Date : November 22 2020, 10:48 AM , By : user2956016
Why Would Different Pointers Act As If They Shared The Same Values?
Why Would Different Pointers Act As If They Shared The Same Values?
This might help you MakePtrArrayB invokes undefined behavior, by using an uninitialized pointer.Undefined behavior can be anything, but in your case, the myArr pointer in MakePtrArrayB probably occupies the same memory as the one in MakePtrArrayA, so
TAG : cpp
Date : November 22 2020, 10:48 AM , By : Eugene Orlovsky
g++ dumped assembly output doesn't work
g++ dumped assembly output doesn't work
wish of those help There are two things you're doing wrong:Firstly, you're the 64-bit syscall instruction, but initialize only the %e part of the registers. Secondly, this:
TAG : cpp
Date : November 22 2020, 10:48 AM , By : Kushan
C++ Rotation matrix issue when used on a square
C++ Rotation matrix issue when used on a square
may help you . Well your problem has nothing to do with whether or not your are developing a console or GUI application. Images are stored and processed as matrices of pixels. When you rotate the image, the resulting position for a specific pixel is
TAG : cpp
Date : November 22 2020, 10:48 AM , By : user2955890
Avoiding multiple objects of same name in C++
Avoiding multiple objects of same name in C++
I think the issue was by ths following , There is no discernible problem with your code nor will there be any issue with multiple objects. The variable p has automatic storage duration and is destroyed when it goes out of scope. When this means is th
TAG : cpp
Date : November 22 2020, 10:48 AM , By : user2955730
Is it possible to get Lexer output from gcc or clang?
Is it possible to get Lexer output from gcc or clang?
I wish this helpful for you Although the parser does poll the lexer without there being a proper "lexing phase" this does not mean that you cannot dump the tokens as they are lexed. This is done with the command :
TAG : cpp
Date : November 22 2020, 10:48 AM , By : user2955722
C++ getline pass file or cin
C++ getline pass file or cin
hop of those help? I searched internet and read manuals for hours but I can't figure out this one: , Streams are not copyable. You have to pass the stream by reference:
TAG : cpp
Date : November 22 2020, 10:40 AM , By : user2955698
Find critical edges of an MST: possible with modified Prim's algorithm?
Find critical edges of an MST: possible with modified Prim's algorithm?
this one helps. This problem is easier than the problem of sensitivity analysis of minimum spanning trees, which is to determine how much each tree/nontree edge can increase/decrease in weight before the minimum spanning tree changes. The best known
TAG : cpp
Date : November 22 2020, 10:40 AM , By : jinglebell
Converting wostringstream to wchar_t* Garbles Values
Converting wostringstream to wchar_t* Garbles Values
will help you The wostringstream::str() method returns a std::wstring by value. You are not assigning that to anything, so its lifetime is temporary and ends when the expression is finished. You are calling std::wstring::c_str() to save a pointer to
TAG : cpp
Date : November 22 2020, 10:40 AM , By : user2955639
Causing segfault in program doesn't get caught by signal handler
Causing segfault in program doesn't get caught by signal handler
seems to work fine So the explanation of this is that RTEMS does not handle signals the way that I thought it does. There are some POSIX signals which are really exceptions at the hardware level. for eg. SIGSEGV, SIGBUS, and SIGFPE. The exact semanti
TAG : cpp
Date : November 22 2020, 10:40 AM , By : user2955615
Undefined symbol: _ZN7QString13toUtf8_helperERKS_ at runtime
Undefined symbol: _ZN7QString13toUtf8_helperERKS_ at runtime
it fixes the issue qmake/cmake is the way to go. But it is interesting to see how come linker succeeds and then during run, we get an undefined reference( not an unmatched dll case ). Especially since there is no preprocessor guard for toUtf8_helper
TAG : cpp
Date : November 22 2020, 10:40 AM , By : user2955560
proper usage of C dummy functions replacement in different environment
proper usage of C dummy functions replacement in different environment
fixed the issue. Will look into that further I am trying to add test functions in a suite on both windows and linux machines. On linux machines i want the real functions to be added and on windows machine i want the dummy UnsupportedFunction to be ad
TAG : cpp
Date : November 22 2020, 10:40 AM , By : user2955556
How do you save images of detected objects in OpenCV?
How do you save images of detected objects in OpenCV?
This might help you The function call that detects the face will most probably contain a boundingRectangle parameter of type vector. Use the data present in it to select the Region of Interest(ROI) if a face is detected. This selected ROI can then be
TAG : cpp
Date : November 22 2020, 10:40 AM , By : user2955555
See if length between two equal numbers in deque is even
See if length between two equal numbers in deque is even
I think the issue was by ths following , I have a deque and I want to find if the number of ints between two equal numbers is even. For example:7,13,4,6,4,13,8,10 should be false and 1,3,5,3,4,8,7,9,6,5,7 should be true. I think my program is correct
TAG : cpp
Date : November 22 2020, 10:40 AM , By : DeltaFlight
Random real in [0..1[ using Mersenne Twister
Random real in [0..1[ using Mersenne Twister
I think the issue was by ths following , This happens because the return value of newr() and newr.max() are integers and the value returned by newr() is smaller than newr.mar(). The result of the division is a zero integer which is then converted to
TAG : cpp
Date : November 22 2020, 10:40 AM , By : user2955427
Writing the contents of a map through operator overloading
Writing the contents of a map through operator overloading
seems to work fine Your operator
TAG : cpp
Date : November 22 2020, 10:40 AM , By : user2955396
Defined operator works in main() but doesn't work in class
Defined operator works in main() but doesn't work in class
it helps some times It does not work in Plane since the Punkt objects are const and the operator- function is a non-const member function.You should make operator- a const member function.
TAG : cpp
Date : November 22 2020, 10:40 AM , By : nitrazepam
Can a throw or delete expression ever be dependent?
Can a throw or delete expression ever be dependent?
it helps some times Let's go back to when typename is required. §14.6 [temp.res]/p3, all quotes are from N4140:
TAG : cpp
Date : November 22 2020, 10:38 AM , By : user2955289
C++ finding the (largest) index of the largest element in an array
C++ finding the (largest) index of the largest element in an array
I wish this helpful for you I have an array of values and a technique for finding the index of the largest element in an array. , In a for loop add an if statement. Something like...
TAG : cpp
Date : November 22 2020, 10:38 AM , By : user2955178
Can sizeof nested twice ever be a dependent expression?
Can sizeof nested twice ever be a dependent expression?
fixed the issue. Will look into that further I noticed that gcc 5.0 rejects the following code, while clang 3.6 accepts it. , I'm using a post-N4296 draft.
TAG : cpp
Date : November 22 2020, 10:38 AM , By : KarthikaEswaran

shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org