Questions tagged as 'c++'

2
answers

Find an element of a struct in a list

given this structure: struct Libro{ string nombre; int codigo; bool disp; }; and this list list <Libro> libro; I would like to know how to find a specific book by means of the code, I mean something so the user places the co...
asked by 31.07.2018 / 02:41
1
answer

QPushButton does not appear

I'm doing a small form with Qt, I insert several QPushButton buttons, but I do not have to add the header that specifies it, nor do I add anything in the .cpp or the .h, but it works perfectly. Is the library included in another? In which?     
asked by 24.04.2018 / 20:01
2
answers

Concatenate vectors with std :: vector in C ++

I wanted to know how you could concatenate two fixes in C ++: For example a = {1,2,3,4,5} b = {6,7,8,9,10} c = a + b //El resultado c = {1,2,3,4,5,6,7,8,9,10}     
asked by 24.06.2018 / 04:25
2
answers

Error message in c ++

These are the methods of my program, when I divide between 0 the error message is printed and then if they print a series of random numbers (I understand the cout of the main is not executed correctly) What is the best way to check that Do not d...
asked by 17.10.2018 / 16:27
1
answer

matrix in table form and diagonal sum

I want the data I entered in an array of 4 rows and 5 columns to be displayed in order when printing, I have only placed a line break and a tab to make it look a bit ordered, but I would like the numbers were separated from each other and closer...
asked by 11.05.2018 / 23:00
2
answers

Problem with While

I'm new to the C ++ language and I have a problem with this cycle. #include<iostream> using namespace std; int main(){ int iterador=0; while (iterador<=10){ cout<<iterador<<endl; iterador+=1;...
asked by 29.05.2018 / 00:27
2
answers

Rare error (Extended initializer lists) [closed]

Good people, I just had an error in this fairly simple code, which I had never seen before. #include <iostream> #include <iomanip> #include <string.h> #include <stdio.h> const int tam = 10; using namespace std; stru...
asked by 09.10.2017 / 22:47
1
answer

Control the speed of a ship and make it move on its own c ++

I would like to know if someone could explain two things to me, the first one to make a ship that moves alone until an x coordinate, and, the second as I can do to control the speed of the ship, my programming teacher told me to use some time, b...
asked by 02.11.2017 / 03:47
2
answers

In C ++ 11 I have a problem using interfaces. error: no matching function for call to 'MyClass :: MyClass (Observee (&) ())'

I am programming a listener (Observer) in C ++ version 11 and if I do a new project I do not have problems doing some simple classes. But when I incorporate these classes into my main project, it gives me some errors that I do not know how to so...
asked by 27.10.2017 / 09:52
2
answers

Call template builder in non-template class from daughter class

I'm doing a wrapper in C ++ for a C library ( libuv , in case there is curiosity). To keep the code as portable as possible, I am using pointers at the original struct . Each type of struct has its own initialization fun...
asked by 05.11.2017 / 08:32