Category "c++"

How do I use SDL2 in my programs correctly?

I want to make a game using SDL2, but I'm unable to compile and/or run my code, please help! SDL2 is notoriously hard to set up, and it's often the first libr

Why I need times in closing files in flow

I'm new to c++ and I have question. I have code like: void FlowState::closeFile() { if (outfile) { //from here struct timeval times[2];

No operator ">>" matches these operands operand types are: std::istream >> double

For my project I'm trying to create a free function for a complex number class. It is defined in the cpp file. The function is an overloaded input streaming ope

how to get the slope of a linear regression line using c++?

I need to attain the slope of a linear regression similar to the way the Excel function in the below link is implemented: http://office.microsoft.com/en-gb/ex

BSTR's and VARIANT's under... mac os x

Under mac os x I have office 2011 and its excel and VBA, and I have gcc-5.3.0's g++. I played a lot to passing arrays (of numerical built-in types) from VBA to

Has the C++ standard committee considered templated namespaces?

Namespaces are in many was like classes with no constructors, no destructors, no inheritance, final, and only static methods and members. After all, this kind o

Can't use enum class as unordered_map key

I have a class containing an enum class. class Shader { public: enum class Type { Vertex = GL_VERTEX_SHADER, Geometry = GL_GEOMETRY_SHADE

Change default working directory in Qt Creator

Is it possible to change the default Working directory in Qt Creator to specified path? Or is it possible to set Working directory in .pro file? PS: I know ab

Why is memory adress getting printed instead the values of array in c+.+

When I'm trying to print the values of an array, its memory location is getting printed instead of values. What am I doing wrong? int main() { int list[3];

How to make a C++ class iterable from Python using SWIG?

I have a C++ class Collection that manages a std::vector<Element> (a private member of the class). From C++ I can iterate through the vector using the b

Beginner C++ Beverage Survey Tally

I am working on an assignment that is supposed to perform a survey tally on people's favorite beverages. Ideally it will continue asking the user to submit a fa

Skeletal mesh not rendering in UE5

I am trying to follow along with a tutorial that was designed for UE4. However, I was wanting to play around with UE5 (since it just came out). I was able to fi

Controlling Program Flow Between VB and C++

I have a program that runs from VB/Excel and executes a C++ program in the middle of it. I have two (I think related) questions: I capture the return value fr

Macro to repeat a single character multiple number of times

I am learning about macros and I want to know that whether it is possible to create a macro that repeats a given character literal a given number of times. For

What does "Symbol not found / Expected in: flat namespace" actually mean?

When I import a module I built, I get this boost-python related error: Traceback (most recent call last): File "<string>", line 1, in <module> Im

How to Upscale window or renderer in sdl2 for pixelated look?

I want this pixelated look in sdl2 for all the object in my screen

how to use shift operator in cout statement as it is overloaded

I am quite new to C++, I know that shift operator in C++ is overloaded. But as how we can do shift operation within printf statement in C can we do similar shif

QT QTest::keyclick or mouseMove seems don't work with QMenu in my case

I have a simple flow Click on QPushButton QMenu with a couple of actions appears Navigate through the QMenu using key clicks or mouse move. (Triggering actions

QWebChannel after I registered some objects I need to register a new object to the Js but it faills to call this new objects cpp functions

At some I need to register some objects with qwebchannel and futher in the application I need to register a new object to the qwebchannel. The thing is that it

Choco-solver IntVar declaration : How to declare an IntVar with two(or more) boundedDomain?

IntVar v = model.intVar("v", 1, 12, true); // or v= model.intVar("v", 20, 30, true); I want the value of IntVar v not only in [1,12] but also in [20,30] and i