C++ on Stack Overflow and Game Dev

1 answer

Dependencies in c++

For example, I have application with wxWidgets framework. It has many classes, which need to communicate with each other (get data, invoking some procedures etc.). Can you advice me about some ...

1 answers | 2 mins ago by Neka on Stack Overflow stackoverflow.com
1 answer

C++ console application always on top?

I am NOT looking for: making another window always on top making any sort of GUI - dialogs etc... on top I am however looking for a way how to make my simple C++ console application to stay always ...

2 answers

Specifying some template paramaters

I want to write an own Vector-class and a function which calculates the cross product. My Vector-class has the template<class T, int dim, bool isRowVector> T is the type of the entries, dim ...

2 answers | 5 mins ago by Michael Palm on Stack Overflow stackoverflow.com
0 answers

Build a vector of GtkWidget references with C++

Here is my code: unsigned gridSize = 4; vector<vector<GtkWidget*> > gGrid; for(unsigned i=0; i < gridSize; i++){ gGrid.push_back({}); for(unsigned j=0; j ...

0 answers

A rule of three - templates messed up

I've been trying to solve this for hours : _ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)); It is probably caused by the rule of three violation, but I am new to templates and it's hard for me to ...

1 answer

visual studio source files building order

i have n number of cpp files in a project.'A' is the source file which will have main function,'B' is an another source file which contains function definition which will be used by 'A'. A.cpp ...

5 answers

What is the correct way of using an auto_ptr on dynamically allocated arrays?

If i use auto_ptr to hold a pointer to a dynamically allocated array, when the auto_ptr gets killed it will use a plain delete operation and not delete[] thus not deleting my allocated array. How can ...

5 answers | 20 mins ago by LoudNPossiblyWrong on Stack Overflow stackoverflow.com
4 answers

comparing a float and integer in c\c++

Due to safety reasons, I need to preform the same computation twice, one time with only integer (int32) variables and another time with only float (float32) variables. At the end of the computation a ...

0 answers

Shader Attachment errors. Either invalid Program or shader

I was working on my graphics program. I am trying to abstract features from the Shaders into a class. I tested the regular drawing Code and it works. The shaders run as well but as soon as I start ...

1 answer

How to inherit from my custom class

I have created a class in Qt that has a number of public properties lets say class items { public: QString name; QString description; How can I create a new class that inherits all the ...

1 answers | 26 mins ago by green_leaf on Stack Overflow stackoverflow.com
0 answers

Auto completer with suggestions and highlights in qt 4.8

I want a auto completer in qt 4.8 with following properties.This is similar to google search suggestions or mail address typing or code completion in IDEs. Auto completer which shows list that ...

2 answers

C++ fstream is_open() function always returns false

I have tried to use open() to open html file in the same directory as the source file. However I dont know why is_open() always return false in my program.... Here is part of my source code one of ...

2 answers | 33 mins ago by SerMintt on Stack Overflow stackoverflow.com
1 answer

what's the signature of C++ deleter?

Since C++ 11, shared_ptr or unique_ptr constructor can have two paramters, with the 2nd a deleter. I'm interested in how this deleter is defined. Some reference only mentions the return type of the ...

1 answers | 34 mins ago by athos on Stack Overflow stackoverflow.com
2 answers

std::map with a custom class as a key returns size of 1 always

I am designing a custom ErrorInfo class which can be implemented by other modules to implement their specific error info class. The errors are maintained in a custom map where the key is a custom key ...

0 answers

Multiple cameras and using cv::VideoCapture::set() to set frame size results in libv4l2 error “No space left on device”

I have two Logitech Pro 9000 webcams. I have discovered a strange behaviour in cv::VideoCapture::set() when setting the frame size (width and height) for my captures resulting in the infamous error ...

1 answer

Splitting image into blocks

i've been working on splitting image into blocks in Qt with C++ and matlab. it didn't work well. maybe you can help me to figure this out. here is my problem: sample image : [http:] ...

1 answer

How to get address in c# function from delegete?

I have some DLL file. It contain some some method with name is "ABSDefaultCallback". So I assign this method like this. IntPtr hMod = LoadLibrary("bsgui.dll"); IntPtr pAddr = GetProcAddress(hMod, ...

1 answers | 59 mins ago by Hemal on Stack Overflow stackoverflow.com
1 answer

How do you pattern match a string in a vector?

I have data in a vector and I need to see if it has the word Buy or Sell in the 3rd element vrecord[2] What is the most straight forward way to look for the occurrences of a string inside a vector? ...

1 answers | 1 hour ago by bro on Stack Overflow stackoverflow.com
1 answer

Chaning the background color of SysLink Control - MFC

I am having problem in setting the background color of a SysLink Control. I have a group box and also couple of SysLink Controls. When I change the back color of group box and also the syslink ...

1 answers | 1 hour ago by NJMR on Stack Overflow stackoverflow.com
1 answer

Can I use all the functionally I see exposed by the .TLH file?

Background: I have an existing code that uses functionality provided by Microsoft, to post XML data over HTTP. Specifically, IServerXMLHTTPRequest (included in MSXML3 and up) from msxml4.dll (COM). I ...

1 answers | 1 hour ago by Rotem Varon on Stack Overflow stackoverflow.com
1 answer

memoization in C++

Given a score by team in cricket, find/print all configs/ways to get to the score. There are 3 ways to score 2, 3 and 7 Example: Score: 10 Output: (0,1,1) (0,2,2) (0,0,5) void out(int score, int ...

1 answers | 1 hour ago by GettingCpp on Stack Overflow stackoverflow.com
1 answer

Calling Python from .NET via C++ bridge

Once per a couple of months I google for "Call Python from .NET" when I am too tired to reinvent/port stuff and find some cool code in Python. The two popular solutions are to start an external ...

1 answers | 1 hour ago by V.B. on Stack Overflow stackoverflow.com
6 answers

C++ Get Total File Line Number

Is there a function I can use to get total file line number in C++, or does it have to be manually done by for loop? #include <iostream> #include <ifstream> ifstream aFile ("text.txt"); ...

6 answers | 1 hour ago by NewFile on Stack Overflow stackoverflow.com
1 answer

C++ ifstream failbit and badbit

In case of ifstream in C++, under what conditions are failbit and badbit flags set ?

1 answers | 1 hour ago by Jake on Stack Overflow stackoverflow.com
1 answer

Segmentation fault in reading a file and writing it to a char vector

Following is a code written by me to read a file and store it in a char vector. #include <fstream> #include "Graph.hpp" #include <iostream> using std::ifstream; using std::vector; using ...

1 answers | 1 hour ago by DesirePRG on Stack Overflow stackoverflow.com
3 answers

Syntax Error: Identifier (Error C2061)

I hate to post something so subtle, but this has me completely stumped on what I am doing wrong: When I compile, it's not liking Class Simulator at all. I get the error syntax error : identifier ...

3 answers | 1 hour ago by AbductedMonkey on Stack Overflow stackoverflow.com
0 answers

QScriptEngineAgent - obtaining callee name

I'm trying to implement a simple QtScript performance profiler via QScriptEngineAgent, by catching function entries and exits. I successfully subscribed to QScriptEngineAgent::functionEntry() ...

0 answers

How do I fix a g++ memory range overlap?

I developed a C++ program that works perfectly in Visual Studio that takes an array of ints, two arrays of C strings, and a large C string, and tries to find if the large C string contains any of the ...

1 answer

Get Nth type of variadic template **when one or more of the types is an interface**

I'm needing to index in to a variadic template to get the Nth type, but I am unable to use std::tuple since I cannot guarantee that all types won't be abstract. For example, the line: using Type = ...

1 answers | 2 hours ago by Duncan on Stack Overflow stackoverflow.com
0 answers

Copy constructor linked list C++

I have created linkedlist class, it works fine. But i'm having problems with copy constructor. It creates a copy which contains the same elements when i print. But later when i remove an element (by ...

15 30 50 per page
1 2 3