Questions tagged as 'c++'

0
answers

Standard Singleton and Prototype

I'm developing a project where I came across the following situation: There are two families of algorithms that use a given object in different ways: the first just read the data and do a processing, the second one modifies the object. My pro...
asked by 27.09.2018 / 13:55
0
answers

Forcing a class to have an attribute

I'm doing a project and I need a parent class (inheritance) to force its daughters classes to have a certain attribute. Is it possible to do this?     
asked by 26.09.2018 / 16:48
0
answers

Methods not found in DLL created "undefined reference to"

I am trying to use a DLL that I did, the DLL compiles without problems but I can not use it, in the project I did I can instantiate, however when trying to use the DLL methods the compiler gives error. This is the header (i9corp / grantalk / m...
asked by 01.10.2018 / 17:09
1
answer

Problem with Segmentation fault with integer pointer

The program below attempts to reproduce a cellular automaton model. When I use "n" (number of cells) in excess of 65K, the program returns Segmentation fault. I tried to "print" some text in several places of the code, but it does not execute...
asked by 27.09.2018 / 21:09
0
answers

Create a c ++ iterator to cycle through a hash table (Separate Chaining)

I'm new to c ++ and I'm not able to create an iterator to traverse a hash table. The table is composed of a vector of n linked list positions (created by me). I need an iterator to go from beginning to end, line by line, to be able to access eac...
asked by 23.09.2018 / 01:00
0
answers

GDB: How to add shared libraries?

I'm using gdb to test my code, however I'm having the following problem when giving run: Starting program: /home/silas/PIBIC/code/gameoflife /home/silas/PIBIC/code/gameoflife: error while loading shared libraries: libhwloc.so.15: cannot open...
asked by 19.09.2018 / 23:19
0
answers

Segmentation fault 11 when reading a CSV file in C ++

Good evening, everyone! Next, I made this code from a response here from the stack overflow and it is giving segmentation fault 11 in the last line of the file, somebody help me to solve, please! This is my code: #include <iostream> #inc...
asked by 20.09.2018 / 02:21
1
answer

'function_name': Identifier not found

void inserePoli1(poli **topo1, int val, int expo) { polinomio1 *novo; char cmd; novo = new poli; novo->valor = val; novo->expoente = expo; if (*topo1 == NULL) { novo->prox = NULL; *topo1 = novo;...
asked by 17.09.2018 / 19:15
0
answers

C ++ - Set and remove specific bits from a single

I'm developing a Gameboy emulator and one of the tasks is to set the flags after each statement: ... //Representa pares de registradores do gameboy union RegPair { std::uint16_t reg; struct pair {...
asked by 05.09.2018 / 16:05
0
answers

Adapt code to return mouse position

I have the following code that shows me the values of the X and Y coordinates when I click twice with the left mouse button. #include <opencv2/opencv.hpp> #include <iostream> using namespace std; using namespace cv; void mouse_ca...
asked by 04.09.2018 / 20:38