Questions tagged as 'c++'

1
answer

Parameterized constructor error c ++

What happens when a class with parameterized constructor is created, without default constructor, and the object of this type is called without argument in constructor in c ++? Does compilation error occur? exception?     
asked by 17.06.2015 / 14:38
3
answers

Undefined reference when compiling multiple files

I'm learning C ++, and I have a question about creating classes in different files. I created the header with function prototypes, then as member functions in another cpp file. When I test the files next to a main I get the following error:...
asked by 04.02.2014 / 19:44
1
answer

2597 - Uri Online Judge - C ++

I'm doing a C ++ program to solve the 2597 math exercise of the ONLINE JUDGE platform below the problem description below. IstarteddoingtheprograminC++,butrealizethattheinputistoolarge,ItriedtomakeaDPtopreprocesseverythingbefore,butIcann...
asked by 05.08.2018 / 17:17
2
answers

Print components from an array in reverse order

I wrote a code to print the components of an array in reverse order. However, it only returns 5 or 6 numbers (at most), even though I have put more numbers in it. #include <iostream> using namespace std; int main() { int i;...
asked by 29.09.2017 / 16:04
1
answer

Problem with Struct

I have the following error in my code:    error: request for member 'media' in 'given', wich is of non-class type   'DataAluno [5]' Code: #include <iostream> using namespace std; struct DadosAluno{ int idade[5]; f...
asked by 13.02.2015 / 06:33
2
answers

Refinement return in C ++

I can not understand what the following function returns. int * begin(){ // return &this->data[0]; } Does such a function return the address of a reference? I did not understand very well.     
asked by 09.04.2018 / 05:04
2
answers

How can I measure the runtime of a program in c ++?

I made a program that randomly generates a vector and then orders it, using bubble sort, now I have to measure the time spent with the ordering.     
asked by 23.02.2018 / 02:30
2
answers

Hexadecimal numbers in reverse

How to print the hexadecimal numbers entered by the user in reverse? For example: Entrada: 0x101c4701 Saída: 01471C10 If possible in Java and C ++. In fact I want to get the information contained within a Windows registry file that loo...
asked by 29.11.2014 / 16:28
2
answers

What is the logic behind this challenge?

QUESTION: In American football, teams compete for field space and score points in two different ways: through the touchdown, which can be worth 6 or 7 points and by kicking the goal, which is worth 3 points. When a team enters the opponent's tou...
asked by 18.08.2017 / 06:29
3
answers

How to read .txt file line from index 0

I have the following code snippet that reads line by line from a text file, end to beginning of string . How do I change it, so that this action occurs in reverse? while (getline (entrada, linha)){ int tam_linha = linha.size(); /* Tamaho...
asked by 25.06.2017 / 22:10