Questions tagged as 'c++'

3
answers

How to make a polymorphic pointer with this pointer in the parameter?

For example, in Qt (correct me, if logic is wrong, I have not done Qt for a long time), you can do this: QLabel label = new QLabel(this); Now let's suppose: #include <iostream> class AbstractBase { public: virtual void A...
asked by 11.02.2014 / 17:22
1
answer

How to add an element at the end of a linked list

I need to add an element at the end of a linked list, I made the method asking it to add as if it were an initial element if the list is empty (is working) and, if it is not, scrolling through the list as follows: else{ Celula * cursor = p...
asked by 24.04.2018 / 17:44
1
answer

How do I add a value to a struct vector, for example in some vector field, since it is from a struct

#include <iostream> #include <vector> using namespace std; struct dados { int pessoas; int consumo; }; int main() { int totalx=0, totaly=0; int n,x,y; vector<dados> info; //int cidade = 1; cout...
asked by 01.05.2018 / 17:43
1
answer

Can I call one program within another?

I want to connect one program inside the other because I have a project (main, 7 Classes) in C ++ / OpenCV that should call a program also in C ++ / integrated with the tesseract, pass and receive an object so that the program will do a processi...
asked by 10.06.2014 / 23:01
2
answers

Data structure in c ++

Hello, when I learned C I made several libraries, from heaps, binary trees, lists, rows ... etc. I would like to know if in C ++ there are libraries that we can import to use more easily, as with the <string> or <vector>...
asked by 05.08.2018 / 23:03
1
answer

What is the noexcept keyword and when to use it?

What does keyword noexcept in C ++ and in what situation should it be used?     
asked by 07.07.2018 / 23:15
1
answer

I want to know how to limit the decimal place in c ++ using std

So I'm doing a simple program and I wanted to know how to limit the decimal place in the input, putting the cin and taking only 1 houses, for example digit 2.6534 and the program only get 2.6. Could someone help me? #include <iostream>...
asked by 03.04.2018 / 03:53
1
answer

How to use a class array as a pointer?

How do I use a class array as a pointer? I tried in several ways, but C ++ would not let me compile errors. An example of the class (Just an example, the class I need to use is thousands of times larger than this) class Pessoas { private:...
asked by 11.12.2017 / 15:47
1
answer

What is the usage limit of .push_back ()?

I often use .push_back(element) when working with vector , but I do not know what the maximum amount of elements I can add to a vector before it overflows and performs the reallocation of a new space in memory. Is there a...
asked by 01.11.2017 / 23:10
1
answer

How do I create an optional parameter in a class method?

I know that to create an optional parameter in a function you can do this: void exemplo(int a,int b=0); But how do I do this in a function of a class ex: class Exemplo{ public: void nada(int,int); }; void Exemplo::nada(int a,int...
asked by 02.02.2018 / 21:57