Category "c++"

Cannot load JPG image Pdfium

I try to do some stuff with PDF for a project. I'm trying to do some interop with Pdfium: https://pdfium.googlesource.com/pdfium/. I want to convert a JPG image

Acces element of QVector pointer containing pointers

I have the following QVector pointer: QVector<someStruct*>* qvp; How can I acces someStruct members? Let's assume that qvp has some elements to access al

Unexpected Program exit with Code 0xC0000417 (Invalid C-Runtime Parameter)

After upgrading a big project to Visual Studio 2013, the program cased a crash (Program stopped working) on a normal computer. Now when I debug this program in

How to check c++ pointer pointing to invalid memory address?

Is there anyone show me how to check my pointer is pointing to an invalid memory address. #include<iostream> class Node{ public: int data; Node * ne

Generating combinations in c++

I have been searching a source code for generating combination using c++. I found some advanced codes for this but that is good for only specific number predefi

How to obtain mesh from Skia path geometry?

I'm trying to figure out how to make Skia produce mesh from path geometry. I've checked SkPath::dump, SkPath::writeToMemory, SkPath::serialize, however all of t

How to make a .lib file when have a .dll file and a header file

I am trying to create an application in visual studio that will be able to access a .dll file that already exists. I need the application to call up routines. I

XOR Operation Intuition

I recently came across this question on Leetcode and figured out a solution that I need some clarification with: Given an array of integers, every element a

May I declare "using namespace" inside a C++ class?

Assume having a C++ class. And there's a namespace which should be visible only inside my class. What to do for that? class SomeClass { using namespace Som

undefined reference to __cxa_end_cleanup'

I'm trying to build a C++ project however as it finishes it throws this error: undefined reference to __cxa_end_cleanup' The toolchain used is ARM GCC 4.7.3

Error in simple g++ inline assembler

I'm trying to write a "hello world" program to test inline assembler in g++. (still leaning AT&T syntax) The code is: #include <stdlib.h> #include &

How to check if a std::thread is still running?

How can I check if a std::thread is still running (in a platform independent way)? It lacks a timed_join() method and joinable() is not meant for that. I thoug

Matplotlib in C++

I would like to use matplotlib to plot an x,y graph. To do this, I downloaded "matplotlibcpp.h" from github : https://github.com/lava/matplotlib-cpp However, in

Sorting array with MPI in C++

I want to sort array of random numbers using MPI library. The idea is to chop array with MPI_Scatterv and send it to the processes. Every process should localy

How to initialize and print a std::wstring?

I had the code: std::string st = "SomeText"; ... std::cout << st; and that worked fine. But now my team wants to move to wstring. So I tried: std::wst

How to get on top-level const pointer using "auto"?

In short words: Per C++ Primer, pg 69, "auto": "If we want the deduced type to have a top-level const, we must say so explicitly". I would get an top-level

Can sizeof(size_t) be less than sizeof(int)?

Can sizeof(size_t) be less than sizeof(int)? Do the C and/or C++ standards guarantee that using unsigned int for array indexing is always safe?

How can I make CMake use GCC instead of Clang on Mac OS X?

I can't find any info on it, but only the other way around (e.g., how to set CMake to use clang). I've installed gcc-4.8 using brew, setup all dependencies, he

sws_scale YUV --> RGB distorted image

I want to convert YUV420P image (received from H.264 stream) to RGB, while also resizing it, using sws_scale. The size of the original image is 480 × 800.

How to check the CRC of the function in C++

Is it possible to count the CRC of code in the memory of the function in the runtime? I have a function that compares user's password with the secret password.