Questions tagged as 'c++'

2
answers

How to order with insert sort a linked list c ++

I have a program in c ++ in which I want to manage the sorting method InsertSort . I request the data with a case in the main.cpp file and then in the file List.cpp I can indicate where to insert it, in this case I have the insertInit....
asked by 04.04.2016 / 07:41
1
answer

Unary operator overhead in C ++

I created the next class. class Persona{ private: std::string nombre; public: std::string getNombre(); Persona operator=(std::string nombre); }; Persona Persona::operator=(std::string nombre){ Persona persona; persona....
asked by 26.03.2017 / 19:45
2
answers

Doubts about C ++ batteries

I have a question with a battery exercise, whose code is the one you have below, what I want to ask is why the operands are unstacked , they are popped, before operating with them ? I mean this: const int r_op = stack_.top(); stack_.pop(); //...
asked by 20.07.2017 / 19:16
1
answer

Observer type bool C ++

I'm trying to solve this exercise: The Dice class manages the launch of 2 dice. A) The constructor receives two optional parameters with the initial value for the given 1 and the given 2 respectively. If the dice do not receive an initial...
asked by 25.08.2018 / 13:33
1
answer

I have two WHILE loops and the second one skips

I am trying to make a program for which I need to store different values in two vectors. To read the values I use two equal WHILE loops, but the one from the second vector is skipped. What happens? The final goal is to see if one vector is a...
asked by 12.09.2018 / 10:12
1
answer

How to enter variables in system?

I am trying to make a code in which the user enters a number and through the system (color) command can change the color. I already tried to change the variables to char, string, (I do not know if I was doing it right), and they give me errors r...
asked by 09.09.2018 / 05:48
2
answers

Read variable character by character

I need to make a program in which you enter a number and see if within that number there is a defined number and according to that number of a different result For example I have to find if at the beginning of a number x are the digits...
asked by 13.09.2018 / 00:52
1
answer

Problem with C ++ program, does not recognize data types well

I have to make a program that determines the population of a certain country after a certain number of years, the years that have to pass so that at that rate it reaches at least twice the initial population, and the population after those years...
asked by 21.10.2018 / 11:54
1
answer

How to show the elements of a stl list of structures?

I am beginning to get a little familiar with the stl and my problem is as follows. In all the tutos they tell you the functions, like adding elements and showing them, traversing them, etc. I have this structure: struct Libro{ string no...
asked by 30.07.2018 / 16:00
2
answers

Doubt about pointers

A few days ago I was doing a project in CodeBloocks, referring to classes, member functions and pointers, which is about entering 2 numbers (1 in each function) and then adding it in another function; Just like this. #include <iostream>...
asked by 16.08.2018 / 06:43