Questions tagged as 'c++'

1
answer

Code for earlier than expected

Follow the code with my suspicions: Header: class Name_pairs { public: void read_names(); void read_ages(); void print() const; void sort(); // Ordenar os nomes com as idades private: std::vector<std::s...
asked by 30.06.2016 / 20:14
1
answer

Is there an insertion method for a binary search tree that is faster than the trivial one?

I'm trying to solve this problem in a judge online. The problem provides N integers that must be inserted, in the given order, into an algorithm for inserting a binary search tree. Then Q queries are performed. For each query the code s...
asked by 12.07.2016 / 21:04
2
answers

How to use operator = to copy a vector of pointers?

Having this class, I would implement, operator =, copy the vector from pointers to int to another vector, is it necessary to reserve memory before doing so? What's the difference between making a builder per copy and implementing the assignme...
asked by 21.12.2016 / 22:05
1
answer

Java function equivalent to c ++ map ()

There is a function for java, equivalent to map () of c ++? Basically it calculates the ratio between the "minimum" and "maximum" values.     
asked by 28.05.2016 / 04:33
2
answers

How to implement operator overload and in C ++?

Hello, I'm doing an exercise that consists of the following statement: Sorryforputtingaprint,butIcouldnotselectthetextanditwouldbeanunnecessaryjobtotypeeverythinghere.Finally,Imadetheclassandimplementedtheoverloadofthe+,-,*and/operators,butI...
asked by 02.01.2017 / 22:01
2
answers

Pointer changes the value inside function in C ++

I have the task of creating four functions that do multiplication, division, addition and subtraction between two numbers given by the user. The operation to be performed must be chosen using the * / - + characters, given by the user. I need...
asked by 06.04.2017 / 20:21
2
answers

Handling Exceptions in C ++

I have a question regarding the handling of exceptions in C ++, the class Fracao below is purposely incomplete does not even have setters or getters and several things were " left "side, has only two attributes and a constructor, and...
asked by 28.09.2016 / 01:26
1
answer

How to import user32.dll and others in C #?

I found several and several results on the internet teaching to import a specific function of user32.dll . But I can not get out of my head if someone has not done a project with all the% done% organized. So this project would matter...
asked by 18.09.2015 / 19:29
1
answer

Checking Directory (WINDOWS)

How do I check if a directory exists using C ++ and Windows API ?     
asked by 13.05.2015 / 21:28
1
answer

Template error returning value

I'm implementing a class that represents an array using template and dynamic allocation. However, when I did overload the + operator (addition) the following compilation error occurred (only when I try to add the objects does the error occur)....
asked by 07.05.2015 / 21:20