Questions tagged as 'c++'

1
answer

Sort from lowest to highest in priority_queue by breaking second element, is it possible?

I am studying priority_queue and a question has arisen, if I want to insert a pair of elements in the priority queue, how do I make the queue show the element with the lowest number and if it has two numbers, does it break the second iden...
asked by 16.12.2018 / 15:00
1
answer

C ++ - Implementation of static class cpp

Hello! I was trying to implement a Static class but I had the following error: "undefined reference to math :: cod" but variable cod is in .h follows the code below class .h and cpp; #ifndef MATEMATICA_H #define MATEMATICA_H class matematica...
asked by 29.11.2018 / 02:13
1
answer

Warning: "No local application has been provided. You can define it in the Run menu, Parameters "Dynamic DLL Creation problem in C ++ in DEV ++

I'm trying to create a DLL with the code that the teacher passed, but it does not compile properly. The warning is appearing:    "No local application has been provided, you can set it in the Run menu, Parameters" What would these Par...
asked by 04.11.2018 / 15:01
1
answer

What's the difference between declaring a variable like constexpr const and constexpr?

What's the difference between declaring a constant as constexpr const to only a constexpr ? constexpr const float max_height = 3.0f; constexpr float max_height = 3.0f;     
asked by 29.09.2018 / 20:39
2
answers

Infinite loop on the switch

The problem is that in all three cases, cout repeats infinitely. #include<iostream> using namespace std; #include<locale.h> int main(){ setlocale(LC_ALL, "Portuguese"); bool a; int consumo;...
asked by 15.08.2018 / 22:52
1
answer

Read from file txt to vector of char

I have a dados.txt file with (fictitious) CPFs in the following format: 382031758-71 647900189-01 460754503-73 696170135-72 And so on, with a total of 500 cpfs. I'm trying to read each one and put char cpf[12] (because each on...
asked by 04.10.2018 / 19:45
1
answer

Inline in an infinite recursive function

What happens to the program if I declare an infinite recursive function inline ?     
asked by 17.07.2018 / 01:54
1
answer

decltype and pointers

I want to know why, when using decltype (* pointer) - using a pointer - it defines the type of the variable as a reference, eg: int i = 42, *p = &i; decltype(*p) c = i; What I want you to understand in my question is this: Now c is a re...
asked by 17.07.2018 / 16:58
1
answer

How to walk through a set with inserted data?

I have a program that inserts some integers into a set, and removes when I find an equal, after doing so, I need to bring in the output all integers that are still inside the set, however I am not able to do set and bring the information I want....
asked by 14.10.2018 / 01:16
2
answers

How to find a comma inside a TextBox

I have a Text Box in which it can only contain a comma, so I thought about having the program detect when the user uses the comma if there already exists one in that particular Text Box. Here is an example of the code I want to get: if(...
asked by 03.08.2018 / 14:55