Questions tagged as 'c++'

1
answer

error: could not convert

Good morning! I try to make an operations program with structs, however when I try to compile it marks the error: error: could not convert 'e.buscarElemento()::Encontrar::nombre.std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operat...
asked by 23.11.2017 / 14:27
1
answer

Why does not my first cin.getline ();

I have the doubt because in my code the first cin.getline(); does not work, it is skipped, but the others do function. #include <iostream> #include <string> #include <stdlib.h> #include <new> #include <ctype.h...
asked by 07.08.2017 / 00:34
1
answer

constructor per copy in c ++

Good day! I wanted to make a query: I'm new to seeing c ++, but I've seen that when they create objects, when making the constructor by copy, when they define the method, what happens is the memory position of the object they copy, and from ther...
asked by 21.09.2017 / 13:52
1
answer

Can you pass as parameters a function in another function in c ++?

I try to create this piece of code as a function, but the function that I have inside this code, I do not know how to pass it as a parameter, how to do it so that I receive it. if ((matriz_juego[i][j] == *casilla2 && matriz_juego[i][j...
asked by 21.09.2017 / 16:53
1
answer

doubt recursion

I have a sample code of a printing procedure recursively in reverse order of the contents of a list that I do not understand. This is the code: My doubt: I imagined the operation of this, I thought it would be like this: start the execution o...
asked by 25.07.2017 / 19:33
1
answer

Doubt with exercise doubly linked lists

I have a battery exercise, it says:    Implement the dll_t void class method   select (dll_t * > & L, const T & x), which saves   within the list L the pointers to nodes of the invoking list that has as content x. also, they give...
asked by 23.07.2017 / 01:24
1
answer

BitConverter equivalent in C ++

I'm having a problem, in C# I did the following function, but when trying to pass the program to C++ with the IDE Qt5.7 I find the problem that BitConverter is reserved word of C# short ConvertBytesToShort(byte msb,...
asked by 26.07.2017 / 22:09
1
answer

How to create an array of n positions, C ++

My question is how to declare an array without specifying the length and then instantiate it in the constructor method by specifying the quantity. To enter the context, I leave the following example. #ifndef GRAFO_H #define GRAFO_H #include...
asked by 16.07.2017 / 18:57
1
answer

Enter only numbers

I would like to know how I can in a QTextEdit allow only the entry of numbers, is there any property for it? PS: I need you not to write or enter the QTextEdit letters.     
asked by 01.08.2017 / 22:34
1
answer

Doubt exercise stack based on lists

I found a solved exercise where batteries and lists are used that generated doubts, this is:    Implement the non-recursive method of class dll_t ostream& write_reverse (dll_node_t<T>* n, ostream& os) const that...
asked by 24.07.2017 / 13:53