Questions tagged as 'c++'

1
answer

unget () and putback ()

I have looked for some definitions and so far I know that unget() must return the last character and putback() can return others that are not the last one. But my doubt would be in the run. I would like to know the practical use...
asked by 22.08.2016 / 21:48
1
answer

Get lower_bound from a multiset in index mode 0

Here's the code: first = mult.lower_bound(c); last = mult.upper_bound(c); if (first == mult.end()) { printf("%d not found\n", c); } else { printf("%d found from %d to %d\...
asked by 31.07.2016 / 10:31
1
answer

QDateEdit component only accepts dates from 1752

Hello, I need to register data with dates of 1500 and 1600 but the QDateEdit component only accepts dates from 1752. Can you change the component? Is there any other component that will replace this? I already tried to change the minimumDate pro...
asked by 24.07.2016 / 20:17
1
answer

How does C ++ padding work?

In several responses here in StackOverflow I have noticed users commenting on padding in data structures. struct { int a; char b; float d; } What is this padding (filler) that exists between the fields of a struct...
asked by 13.02.2015 / 13:29
1
answer

Error importing class C ++

I'm trying to use a library in my C ++ project with CMAKE, the problem that the library is loading the System class, not my class that has same name only the namespace that changes. It is as follows: -ROOT main.cpp DataBase.cpp Dat...
asked by 24.06.2016 / 18:04
1
answer

Struct with char vector

So folks, I created this struct typedef struct{ int inicio; int tamanho; int fim; char *elementos[50]; }Fila; And I intend to create a vector of char, just as I created several times a vector of integers. But it is not worki...
asked by 13.06.2016 / 07:01
0
answers

How can I get the checksum of a code128 barcode in C ++?

I compared my results with others , and it looks like my checker digit is incorrect. Here is my function: QString Barcode::StringToBarcode_Code128(const QString &value){ QString returnValue = QString(); const int length = value.le...
asked by 07.07.2016 / 13:31
2
answers

Generation random numbers C ++

Hello, I am writing a C ++ simulation and I have to generate some random numbers. For this, I initialize (srand (time (NULL)) once only and I have a method as follows: void Supermercado::geraTempoProximoCliente() { int intervaloProximoClie...
asked by 18.10.2016 / 14:21
1
answer

Segmentation Fault when initializing Code Blocks in Fedora

Error presented:    Try to migrate conf-folder       The places where the configuration files and user-data files are   stored have been changed to be more standard-conform.       Now moving "/root/.codeblocks/share/codeblocks" to   "/root/...
asked by 16.06.2016 / 01:28
1
answer

Reference return with possibility of invalid object

I have a class of a tree B that has a search method, the search method should return a reference to the value associated with the searched key, so the user can change it if you want, this is a pair used in the tree : template<class Key, cla...
asked by 05.05.2016 / 04:05