Questions tagged as 'c++'

1
answer

What is the purpose and how is the buffer cleaned?

I am an initiate in programming and I am studying arrays and pointers but I have run into the buffer issue and I would like to clear up two doubts: What is the purpose of cleaning the buffer? How is the buffer cleaned? I have seen that...
asked by 27.08.2016 / 00:57
4
answers

Declare array inside loop vs empty it on each loop

I wonder if in C / C ++ it is better to declare a new array every loop loop: while(true) { char array[255] = ""; // Hacer algo con el array ... } Or empty it every turn of it: char array[255] = ""; while(true) { for(short i = 0; i...
asked by 09.04.2016 / 19:36
1
answer

Motion constructor in C ++

I am studying the movement constructor in C ++ that receives a reference to an r-value of the type of the class. The problem is that despite seeing several C ++ Deitel books and several others, I can not find anything of the movement builder...
asked by 17.01.2018 / 12:49
2
answers

How can I use sort with a pointer vector?

I'm trying to use sort with a vector type vector<node*> where node is a variable that I created myself. However I am not succeeding, it does not let me put that function inside the sort method. This is my code: int compOrga...
asked by 15.12.2017 / 12:53
2
answers

Insert an array in one position within another

I'm doing an exercise of POO but with pointers, and I have to insert an array into another in the position that is requested, without overwriting or losing those that are, just move it. In the function void IntArr::addElement(int po...
asked by 18.04.2018 / 20:00
3
answers

operators &, * in c ++ and its use in classes

In the method within the object class ... what is the difference between int getEdad(){ return edad; } int& getEdad(){ return edad; } int* getEdad(){ return &edad; } Any more detailed course or explanation of pointers...
asked by 18.12.2016 / 22:50
3
answers

Does not recognize double-float templates

I have this code in which I try to approximate the natural logarithm of a number, but I can not use if , while or for , only the if ternario, but at the time it compiles I'm shot errors that T is ambiguous and th...
asked by 27.09.2018 / 04:21
2
answers

Reverse list recursively in C ++

I am trying to revert a list recursively. The problem is when the recursive function arrives at the base case. This should return a pointer to the last element in the list. If I print the pointer before the return (inside the function) the value...
asked by 02.02.2017 / 01:22
1
answer

Copy and destructor builders in C ++ 98

This is a small wrapper for a system of binnacles; the used library is in C, so I have simply added an interface to std::stream : #include <sstream> #include <iostream> class ILogger; class Stream { friend class ::ILogg...
asked by 03.03.2018 / 23:02
4
answers

Ratings from 0 to 100

   Make a program in c ++ that asks me for a qualification and validates that it is valid between 0 and 100,   Once it is valid if it is greater than or equal to 70 it is approved, if it is less than 70 it is rejected, but if it is 0, it repeats...
asked by 20.07.2017 / 16:39